shahin
Active Member
I've written a script which is supposed to compare the content of column A between two sheets in a workbook to find out if there are partial matches. To be clearer: If any of the content of any cell in coulmn A in sheet 1 matches any of the content of any cell in coulmn A in sheet 2 then that will be a match and the script will print that in immediate window.
As I've a very little or no knowledge on vba core functionality, I can't solve it myself. Any help to fix this will be highly appreciated.
I tried like this:
The thing is I can't make use of this "paramlist" defined within my script. I just used it there as a placeholder.
As I've a very little or no knowledge on vba core functionality, I can't solve it myself. Any help to fix this will be highly appreciated.
I tried like this:
Code:
Sub FindPartialMatch()
Dim paramlist As Range
Set paramlist = wbO.Sheets(1).Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
For Each cel In wbO.Sheets(2).Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
If InStr(1, cel(1, 1), paramlist, 1) > 0 Then 'I used "paramlist" here as a placeholder
Debug.Print cel(1, 1)
End If
Next cel
End Sub
The thing is I can't make use of this "paramlist" defined within my script. I just used it there as a placeholder.