Writing into next empty cell horizontally (across BO, then BP etc...)

I have a UiPath function that writes the current dates into excel when I run the function.
I have a write cell function with a variable. If for example I am writing at Cell BO2, for the next writing of the value how I can Increment in excel to BP2, then BQ2, then BR2 etc…

Previously I would use BO+“:”(variable+1) to go to the next increment/empty row then increase the variable value by one in order to keep writing into an incrementing row- is there an equivalent for columns? (e.g. is there a function that does BO +1 and then this becomes BP?

Thank you!

Hi,

How about the following expression?

UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnLetterToColumnIndex("BO")+1)

We can also use int32 variable as column index then convert it to alphabet of A1 style when it’s necessary.

colIndex = colIndex +1

Then

UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(colIndex)

Regards,

1 Like

Thank you!!! Will try it out - really appreciate your time!

This is amazing. Thank you for the solution!!

1 Like

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