Add Calender Weeks

Hi Everyone,

I have the following requirement. The Robot will have to add a new row where it will fill in the new calender week. For example: if in the Column “KW” the last row is 2 then in the latest run it will a new row with the value 3. And this will go with every run, until the value is 53. When the value is 53 then the robot has to start over again from 1 in the new row. I hope i could make it clear and the screenshot is also being attached

Any suggestion and hep would be highly appreciated Thanks

Hi @Tarif_Mohammad

Maintain a variable representing the current week in your sequence/workflow, say CurrentWeekNumber.
When a new row is being added, check the value of ‘KW’ from the last row. Assuming you run a loop (or take row count of the sheet), you will be able to find the “KW” value in the last row.

CurrentWeekNumber = CInt(row("KW"))

If CurrentWeekNumber = 53
->->NewDataRow("KW") = 1
Else
->->NewDataRow("KW") = CurrentWeekNumber + 1

Run a few tests to make sure you’re getting the value you expect, or make tweaks as needed.

I hope this helps.

1 Like

Hi @RPAForEveryone Thanks a lot for the quick response. I have been running some test, its running errorfree but not writing the values, I m uploading the XAML here

Main.xaml (10.9 KB) ,

could u please have a look ? I would highly appreciate.

here the excel also if u need

Test2.xlsx (8.7 KB)

Solved , Thanks alot @RPAForEveryone

1 Like

Awesome!
I’m glad the solution worked for you.

Happy automating!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.