How to get a cell number from the value in the excel sheet


#1

Hi,

Assume i have cell from A to D and my item(X) resides at D5.
I’m able to get the item (X) from the column D, but how do i get which row it falls (D5)?

any suggestion … :confused:


#2

This can be done using Macro.

Search for the value in the sheet using the macro,
and if the value is found use this:
MsgBox Replace(Cells(i, j).Address, "$", "")

Here i and j are the row and column integers


#3

What answer do you want in the output?

Row Index? Which is 4 (5th row. in Datatable)

Cell cound ? Which is D5.


#4

thank you, but i can’t use macro here. I want to achieve just by using uipath.


#5

cell .which is D5. :slight_smile:


#6

You can execute an excel macro using UiPath.Please check.


#7

Let’s start with a bad solution ( I need to think of better one).

If you know the Range, create datatable the columns as A,B,C,D and perform read Read range.

Do foreach loop

If(row(col)= item X)
{
Cell number = col.tostring+rowIndex.Tostring() (hmm…or rowIndex+1).Tostring)
}

One more bad solution:

Take Alphabets in Array - A B C D

Iterate the Array by use Read Cell till you get the Value and Cell Number.


#8

#9

yes UiPath just executes that macro created in excel sheet. I just want to use activity and .net code available.


#10

let me try . thanks for the quick response .