Hi problem with Datatables

Hi UiPath gurus, i require some help with this problem. i have two 2 sheets in the workbook. first is the summary sheet, second is weeknumber sheet that generates a different data table each week. How am i to get the value from the week number sheet to the summary sheet each week, however the new data must be pasted under the correct weeks column. basically the task i have to copy and paste this column from the summary sheet to the week number sheet, however the weekly data scrapped must be pasted in the corresponding week number column, and this should be done for every week. please save me guys

let me draw yall an example, since i am unable to post an image of it

Summary Sheet Datatable:
|1 |
|2 |
|3 |

Weeknumber Sheet Datatable:
|1 | 20 |
|2 |40 |
|3 |10 |

Hi @dylankiu,

I would break this down into a few steps for clarity.

First - Read new weekly into data table, filter to only have the Data column from that table to WeekNumberDT

Second - Identify the correct column in the Summary Sheet:
If the title of the week number sheet excel includes the week number then you can use that, or if you are running it on the week the file is generated you can use the current date to work out the month / workweek number.

Assign - CurrentWeekNumber = system.Globalization.CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(Now,System.Globalization.CalendarWeekRule.FirstFourDayWeek,DayOfWeek.Monday)

You can then loop through each column to identify if it contains your workweek number using
ForEach SummarySheetDT.Columns (TypeArgument = DataColumns)

To find ColumnLetter you can use this:

Once you have identified the correct column, you can then use write range for your WeekNumberDT to that column in excel using ColumnLetter+ "2" in the range

Hi TimK,

Thank you for the quick response, i cant wait to try out the solution you provided, and yes the title of the weeknumber sheet is indeed the after the week number. for example this weeks weeknumber sheet will be named “April.W15” as i have a “confiq file sequence” where i will use “read cell” on another excel sheet (where i have wrote down some excel formulas) and read the week number, resulting with a string: weeknumber. hence the file weeknumber sheet.

1 Like

Great, that should make things easier. Let me know how you get on with the build :slight_smile: