Unable to select perfect string


I have data in varaiable as string and i need to compair it from excel and need to get the index of row.
if varaible contains string data like “sandhyar” , i need to check in which row exact data is there after ( .
you can seee below image where exact data is in 7 th row but code which i am using giving me wrong index as 1 .

help me on same.

HI @Mathkar_kunal

I assume you used look updatatable

if you know that the text will be alway after (

you can use the lookup value as “(sandhyar” like this


1 Like

Hi @Mathkar_kunal

Use for each row to loop over your datatable let say ‘dt’,

check condition if CurrentRow(“columnName or Index”).ToString.Contains(yourVar) then
get row index using dt.Rows.IndexOf(CurrentRow).

Note: yourVar=“sandhyar” and contains check for exact match (case sensetive).

1 Like

HI @Mathkar_kunal
as per my understanding, you are looking for exact data present in variable, but after the ‘(’ symbol.
can you append ‘(’ and try searching (sandhyar in excel.
Let me know if this was helpful.

1 Like

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