How to check if an element exists in a column

I have two columns of data, one for all employee names, and one for employees who participated in the punch-in. And I use “read range” to store them as “Name” and “punchname”.
When looping the “punchname”, I want to judge whether each name exists in the “Name”.
This is my error, I want to know how to solve.

Thanks!

Hey!

Try like this…

Take one more for each row in Data table and in the if condition pass the expression like this…

CurrentRow("ColumnName").ToString.Trim.Equals(CurrentRow2("ColumnName").ToString.Trim)

Reference:

Regards,
NaNi

1 Like

Hi

Can you try the following expression in the condition?

punchname.AsEnumerable.Any(Function(r) r(0).ToString = CurrentRow(0).ToString)

Regards,

1 Like

Thanks! I solved it!

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