Counter.toString results in wrong row


I have a problem with my counter.toString variable. I want to fill rows in excel and start at B2. The bot iterates through another excel file with IDs, which are needed to find the necessary information. After every iteration counter increases with 1.

So the first row is B2 then B3 and so on. But the problem is it adds the 0 as a String so it starts at B20 instead of B2. Does anyone know what I did wrong?


Instead of counter you can use Index of the For Each Row

Check as below for your reference

Hope this helps you

Follow Link


Thank you but I found the solution. I had to set the Cell to “B”+counter.toString and initiate the variable at counter = 2. So it starts right after the header

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