I need to compare two lists that don't exactly match. I've tried using find and I've tried using like and the wildcard. I keep getting an error when I use the wildcard with a variable in an instr function here's the code I'm using:
Sub Mark_cells_in_column()
Dim FirstAddress As String
Dim MyArr As Variant
Dim Rng As Range
Dim I As Long
Dim Acell As Range
Dim Bcell As Range
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set ARange = Sheets("Attendees ND").Range("C2:C1310")
For Each Acell In ARange
'Search Column or range
Set BRange = Sheets("Q1 Closed Deals").Range("A:A")
For Each Bcell In BRange
If InStr(ActiveCell.Value, Acell) Then
Do
'mark the cell in the column to the right if "Ron" is found
Bcell.Offset(0, 4).Value = "Yes"
Loop While Not Bcell Is Nothing
End If
ActiveCell.Offset(1, 0).Activate
Next Bcell
Next Acell
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Sub Mark_cells_in_column()
Dim FirstAddress As String
Dim MyArr As Variant
Dim Rng As Range
Dim I As Long
Dim Acell As Range
Dim Bcell As Range
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set ARange = Sheets("Attendees ND").Range("C2:C1310")
For Each Acell In ARange
'Search Column or range
Set BRange = Sheets("Q1 Closed Deals").Range("A:A")
For Each Bcell In BRange
If InStr(ActiveCell.Value, Acell) Then
Do
'mark the cell in the column to the right if "Ron" is found
Bcell.Offset(0, 4).Value = "Yes"
Loop While Not Bcell Is Nothing
End If
ActiveCell.Offset(1, 0).Activate
Next Bcell
Next Acell
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub