Look Up Range - Get the row index if the keyword matches only the entire contents of a cell

Hi Guys,

Just wondering how to use the look up range activity get the address of the cell containing the search word. The cell contents should match entirely. For example, I have three values in the below column

ATMPD - Let say this is found C11
AT - This found in C12
ATE - This one in C13
ATS - This in C14

Lets say if my keyword is AT and the exact match is C12. But the lookup range gives C11 as AT is also part of ATMPD. How to get the exact match in look up range?

Thanks
Zackariya

Hi ,

Lookup datatable working fine for the same case with integers but not with strings so please try this ,

dtRead.Rows(1).ItemArray.ToList.FindIndex(Function ( c ) c.ToString.Equals(“Your String”))

Will give you an index , where 1 is your column number

Hi,

Thanks for your time. I have tried your above solution but it doesn’t help. It didn’t give me the row index. Any other method?

Hi ,

Try this :

index = (dtRead.Rows.IndexOf(dtRead.AsEnumerable().Where(Function(row) row(“Description”).ToString.Equals(“Schedule”)).ToArray()(0))+1).ToString

where “Description” should be your column name and “Schedule” will be the string you want to search.

2 Likes