I have an excel template, in which first i have to count number of rows present in the template after finding the number of rows, i have to update the serial number for each row like 1,2,3,4…
The below attached is my template sample. help me to do this
Thanks in advance
Initialize an int32 variable counter with value 1, then loop through your datatable and for each row, set the value with column name ‘#’ to the counter.
Increment the counter on each loop.
Finally write the datatable back to the Excel
Thanks, but I have a doubt… as a first step i have to count no of rows till subtotal row in excel, based on the no of row count i have to update the serial number. can i do that using the above method
Surely, you can add an “if” condition to check when your counter is equal to the row count, you can use a “break” activity to break out of the “For Each Row in DataTable” activity.
For Each r as Datarow in DT.Asenumerable
Use This Query in Invoke Code
@Nishant_Banka1 I tried its working Thank you
For less code, you can use the currentRow index instead of the counter variable.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.