How to type into a cell which is in a same row of a selected text

Hi Robot Master,

I am currently working on a project where I have to type into a specific cell which is in the same row as a selected text

Example:
Example1

After verifying the name John, it will type 60cm into “width” which is in the same row as John, likewise with Russell

Please help and thank you!

Hi Xuan @Captainshame

Are you using Studio or StudioX?
Since you want to repeat this process on a loop, you have the option to work with datatables where you can update the columns by referring to the current row in a for loop. That way you can always be sure the correct column is getting updated.

In either case, what you need is the row number e.g. if value in cell A2 is John, you want to update C2 in the sheet with 65 cm.
This means you want to get the value - 2. I presume you already have the reference of the cell A2 as you said you are able to verify the value John in Name column.
Deduce the row number i.e. “2” from “A2” by removing the ‘column’ reference from the cell number. (i.e. removing “A” because you know which column is titled “Name”)

Let’s say the row number is stored as rowNumber.
Then use "C" + rowNumber to update the corresponding width column.

Hi @RPAForEveryone

Im currently using studio.

Let say if this is a web table, would the steps still be the same?

If you’re dealing with a web table on a browser, it’s a comparatively different story because you can’t use integrated Excel activities.
But the logic is essentially the same. In a webtable, usually the rows and columns will follow a consistent naming convention,
e.g. A datarow may look like <id='tableRow' row='row1' col='col1' />
The above is strictly a sample selector.

Inspect two neighbouring rows, and columns of those two rows. This will show you how they are different, then put a generic logic to match the pieces that uniquely identify each row and column.
Use ‘UiExplorer’ for more details, just using ‘Edit Selector’ may not give you all the details you need.

Aight! I will give it a try then

Thank for your help!

1 Like