How to change the cell reference value with a variable? I want to replace the current row number #2 with a variable value so that I can read the cell dynamically. Please help


Try this.

Excel.Sheet("CHECK1-P0  LR = 0").Cell("AK"+rowVariable.ToString)

Thanks,
Ashok :slight_smile:

Assign rowVariable=2

Then

Try this:-

Excel.Sheet(“CHECK1-P0 LR = 0”).Cell(“AK”+rowVariable.ToString)

Thanks Ashok, this is very helpful! :slight_smile:

Glad it helped. :slight_smile: Please mark it as answer so if anyone in the community faces same issue, they will get the answer quickly.

More generic:
It helps to check what datatype you are working with. The cell reference isn’t an actual cell reference, but it is a String, which you and I, as well as the activity interpret as a cell reference.
And, knowing it is a string you can do anything with it you like as far as strings go.

Comparable example: you extract the field from a textbox in a webform. The field contains a phone number. → This is not a number, it is a string containing the characters of a phone number.