Get value of selected excel cell



I need to get the value of the selected cell in excel, suppose if I have selected B1 then the value of the B1 cell should get picked.



You can try this way:



I can’t give rownum as it is dynamic


then store the value in a variable and pass it on to Rownumber


If you need to get the selected cell, then you might need to consider Invoke VBA and extract it from excel directly. However, it depends on what you are trying to do and you might not actually need to do that.

If you use Read Range or Read Cell activities, then you don’t need to get the selected cell as those activities will give you the values from the table.

As @phyogananda mentioned, if you have a datatable from the Read Range, then you can use .Rows() and/or .Item() to get the values you need.

EDIT: also, if you don’t know the row number, then you can use the “For each row” on the datatable until you find the row that matches a specific value.