during a for each row loop the robot copies numbers one by one from Excel Column A into an application and searches for a String-Information. Then the output string should be written in the same Excel Sheet in Column B into first row.
But my problem is, that the output is written in the 10th row.
Before the loop starts I assigned Index = 0. After each search (for each row loop) the index will be increased by 1 (index = index + 1)
I use for writing the output the “write cell” activity (“B1” + index.toString() )
What do I need to change?
Thank you very much in advance!
"B1" + index.toString() is equal to
"B1" + "0" which is cell “B10”. Remove the “1” from the first part and it should work.
Thank you very much for your support!
I have removed “1” and changed text:
But I received following Error: “The range does not exist”
Add in a message box or write line immediately before where the error occurs. Put in “B” + Index.ToString and make sure it matches what you expect. I have a feeling Index is at 0. Since “B0” is not a valid range in excel, you should change it so it is “B” + (Index + 1).ToString
That’s my mistake, we should expect this error since B0 does not exist! You should instead use
“B”+ (Index+1).ToString() because excel is 1-indexed not 0-indexed. Thus B1 is equivalent to index 0.
@DanielMitchell & @Dave
Thank you very much! It works
Have a good evening!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.