Hello
I am trying to find a string in Column D and Column H and if they match certain criteria, insert the string "Match" in Column W.
For example, if the string "Auditorium" occurs in Column D and the string "INTERNAL" occurs in Column H on the same row, insert the string "Match" in Column W.
My code below inserts the string "Match" in Column W against all rows that contain the string "INTERNAL" irrespective of the string in Column D!
Any advice would be appreciated!
<tbody>
</tbody>
I am trying to find a string in Column D and Column H and if they match certain criteria, insert the string "Match" in Column W.
For example, if the string "Auditorium" occurs in Column D and the string "INTERNAL" occurs in Column H on the same row, insert the string "Match" in Column W.
My code below inserts the string "Match" in Column W against all rows that contain the string "INTERNAL" irrespective of the string in Column D!
Any advice would be appreciated!
Row No | Column D | Column H | Column W |
1 | Auditorium | Martin (INTERNAL) | None commercial rate |
2 | Auditorium | John | |
3 | Theatre | Edward (INTERNAL) | None commercial rate |
4 | Theatre | George |
<tbody>
</tbody>
Code:
Dim celA
Dim celB
For Each celA In Range("D1:D50")[INDENT]For Each celB In Range("H1:H50")[/INDENT]
[INDENT] If InStr(1, celA.Value, "Auditorium") <> 0 And InStr(1, celB.Value, "INTERNAL") <> 0 Then celB.Offset(0, 10).Value = "None commercial rate"[/INDENT]
[INDENT]Next celB[/INDENT]
Next celA