I have two lists and want to compare to find matches, but in one they are strings and the other they are values. I tried to load the numebrs into a string array but got "invalid qualifier". Here's the code:
Sub t()
Workbooks("Book1.xlsx").Activate
a = Application.WorksheetFunction.CountA(Columns(1))
ReDim d1(a) As String
For x = 1 To a
d1(x) = Cells(x, 2).Value
Next x
Workbooks("Book2.xls").Activate
b = Application.WorksheetFunction.CountA(Columns(1))
ReDim d2(b) As String
For c = 2 To b
d2(c) = Cells(c, 1)
Next c
For x = 1 To a
For y = 2 To b
If InStr(1, d2.Text, d1(x), 1) > 0 Then Rows.Interior.ColorIndex = 8
Next y
Next x
End Sub
Anyone know how I can compare? I don't want to convert the numbers stored as text in the worksheet. They are text in Book1 and numbers in Book2. Thanks.
Sub t()
Workbooks("Book1.xlsx").Activate
a = Application.WorksheetFunction.CountA(Columns(1))
ReDim d1(a) As String
For x = 1 To a
d1(x) = Cells(x, 2).Value
Next x
Workbooks("Book2.xls").Activate
b = Application.WorksheetFunction.CountA(Columns(1))
ReDim d2(b) As String
For c = 2 To b
d2(c) = Cells(c, 1)
Next c
For x = 1 To a
For y = 2 To b
If InStr(1, d2.Text, d1(x), 1) > 0 Then Rows.Interior.ColorIndex = 8
Next y
Next x
End Sub
Anyone know how I can compare? I don't want to convert the numbers stored as text in the worksheet. They are text in Book1 and numbers in Book2. Thanks.