How to find the value in excel

I have to find the particular value cell address for example if 123 in A1 cell the result should be A1 without using lookup activity

Hi @sruthesanju ,

So you want to find 123 value in whole excel or on particular column.

Yes in whole excel

Hi @sruthesanju

Hope these steps would help you resolve this
–lets take you have a datatable named dt
–use a assign activity and get the column count like this
int_colcount = dt.Columns.Count

where int_colcount is a INT variable
and use another assign activity mentioning
counter = 0

where counter is a INT variable

–now use a FOR EACH ROW activity and pass the variable dt as input and it will be having a variable named CurrentRow
–inside this for each row loop use a WHILE LOOP activity where pass the condition as
counter < dt.columns.count
–inside this while loop use a IF condition like this
dt.Rows(Currentrow)(counter).ToString.Contains(“123”)

if the condition satisfies it will go to THEN part where use a assign activity to get the index of the row column position like this

str_celladdress = Convert.ToChar(65+counter)+(dt.Rows.IndexOf(currentrow)+2).ToString

still being inside the while loop, next to this IF condition use a assign activity like this to increment the counter variable
counter = counter + 1

Cheers @sruthesanju

I need to find in excel not datatable

1 Like

No worries

here you go with solution.

if the activities are not visible, delete the PROJECT.JSON file from the folder and open the XAML file directly

rowcolumnindex.zip (9.1 KB)

Cheers
@sruthesanju

Hi @sruthesanju ,

Try below code, it will give you both row number and address.

FindValue.xaml (7.7 KB)

Note:
Don’t forget to install highlighted package.

Enjoy!

Hi @sruthesanju ,

Is it worked?

Yes it’s working…thanks

1 Like

Great!

1 Like

hi @sruthesanju
is there any issue in the provided xaml
Did that work for this scenario

Yes worked

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.