Hello,
Please find attached my problem. If you open it, it is very easy to understand what I want.
Thanks,
Tepke
Hello,
Please find attached my problem. If you open it, it is very easy to understand what I want.
Thanks,
Tepke
Maybe this will help.
The complexity of the strings is to allow for the fact that some names may be substrings of other names so I've included commas to ensure that an entire match is made.Sub Test() For N = 6 To Cells(Rows.Count, 2).End(xlUp).Row MyString = "," & WorksheetFunction.Substitute(Cells(N, 2), " ", "") & "," For M = 3 To Cells(5, Columns.Count).End(xlToLeft).Column If InStr(MyString, "," & Cells(5, M) & ",") > 0 Then Cells(N, M) = 1 Else Cells(N, M) = 0 End If Next M Next N End Sub
Martin
Dear Martin,
Thanks a lot! I have quickly tried and it works.
Tepke
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks