How to increase counter for cell in excel

Hello all, here I ha one data table varible. which having value is always changed.
so i want to store this value in excel. I want to start From B2 cell., after that data table variable value should be write in b3 , b4 respectively… how to do that?

1 Like

Hey @Bhargavi_Lokapur

The above is possible. But,

Could you please explain with some screenshots ?


Hi @Bhargavi_Lokapur ,

Firstly use read range activity to read excel file which gives output as datatable, say, dt.
assign counter as 0.
for each row in dt
use write cell B+(counter+2).tostring
Increment counter, assign counter=counter+1
Hope,this helps.

Hello @Bhargavi_Lokapur ,

As you mentioned the datatable variable is always changing. What does that mean? Are you getting some table data from some application and you want to write that to excel? or the datatable will be having only one row of data.

It would be better if you can share more details about the requirement. looping through the excel rows and writing to excel is possible using the counter variable.