hey guys,
I’m starting with UiPath and I have an Excel numbered from 01 to 31 and I would like the bot to open the tab according to the previous or current day.
example: today is the 10th, it would look for the tab named “10” and insert information in cell C2
Hello @Gabriela_Menezes, you should create an input argument that uses the current day to open the right tab on excel.
Create an argument that has a dynamic input trough Orchestrator, then use it to write whatever you want or need in the excel file.
Hope it helps, cheers! 
1 Like
Anil_G
(Anil Gorthi)
3
@Gabriela_Menezes
Now.ToStirng("dd") - gives todays dat which is 10
Now.Adddays(-1).ToString("dd") - gives yesterdys day which is 09
use the above in sheetname
cheers
2 Likes
Something along these lines:
1 Like
Gokul001
(Gokul Balaji)
6
To get the Previous date
Datetime.now.addDays(-1).tostring("dd")
Regards
Gokul
1 Like
Gokul001
(Gokul Balaji)
7
For inserting the data in the cell you can try with Write cell activity
1 Like
Anil_G
(Anil Gorthi)
8
@Gabriela_Menezes
please give like below
Excel.Sheets(Now.Adddays(-1).ToString("dd")).Range("C2")
two mistakes are assigning date in the same expression and using a reserve keyword date as variable
cheers
1 Like
Gokul001
(Gokul Balaji)
9
Just update on you expression @Anil_G
Use this below syntax in the Write cell activity @Gabriela_Menezes
Excel.Sheet(Now.Adddays(-1).ToString("dd")).Cell("A4")
1 Like
system
(system)
Closed
11
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.