The robot looks for yesterday’s date in the excel file and copies the columns with yesterday’s date. How to make sure that you are looking not for yesterday’s date, but for the last one? Thanks.
ExcelUpdate.xaml (9.5 KB) Sample1 (2).xlsx (10.2 KB)
What I understood, you are trying to find the data which is of last day or yesterday, i think you can use simple Linq query:
dt.Select.Where(Function(x) CDate(x.Item(“Date”).ToString.Trim)=Now.Date.AddDays (-1)).CopytoDataTable
Then you can write this dataTable in another sheet.
I think it’s best to look for the most recent date. There is no need to write to a new sheet, since the robot must find the last date on the sheet, copy it and save the formulas in the cells. At the moment, it copies exactly yesterday’s date, but it is necessary after the last one. Sorry for the stupid question, will LINQ query store formulas in cells?
Might sorting the sheet and picking the first line after solve the problem?