I’m having an issue writing a variable into the next empty cell.
I need to get numeric date out of SAP every morning and put it in the right field in column B. So for 1st of April I want it to automatically fill in Cell B458. Then when I want to run the robot tomorrow it needs to fill it in in B459 etc. I created a variable for the SAP data so all I need is a formula to copy it in the next empty cell.
I checked the other topics about this on the forum but both read range and write cell don’t seem to work. Can anyone help?
u can create a excel file which store the cell number on which u had written yesterady and then read the excel again, and retrive it and increment it by one and write in appropriate cell under excel B column .
If the intention is to always fill the next empty row based on ColumnB.
What you could do is before you generate
Variables Needed
Create a new variable = {lastRow}
DataTable Variable from your Excel File = {dtSAPDate}
You can first Assign your variable
lastRow = dtSapDate.Rows.Count.ToString
~This basically gives you a string value of the last row, in your example, the case shall be “457”.
After which, your write range could be as per
“B” + (Cint(lastRow) + 1).ToString
Which basically gives you “B458”, and this can be repeated the next day, after which the robot will give you a new lastRow number if it has been populated the day before.