I have a column with 10 serial numbers I want to find within another column of hundreds of serial numbers. I want a macro to be able to sequentially read each of the 10 numbers and give me the cell address of a match from the large list.
When using the Find function, is it possible to point to a cell that contains the search string?
for example:
Range("A1:A1000").Find(cell address of the serial number I'm looking for)
I hope my question is clear, I'm new to VBA
Dim foundSerial as Range
Dim i as Integer
i = 1
For Each cell In Range("B1:B10") ' Serial numbers to look for in column A
Set foundSerial = Range("A1:A1000").Find( cell address of the serial number I'm looking for +i)
If foundSerial Is Nothing Then
Cells(i, 3).Value = "Not Found"
Else
Cells(i, 3). Value = foundSerial.Address
End If
i = i + 1
Next
When using the Find function, is it possible to point to a cell that contains the search string?
for example:
Range("A1:A1000").Find(cell address of the serial number I'm looking for)
I hope my question is clear, I'm new to VBA
Dim foundSerial as Range
Dim i as Integer
i = 1
For Each cell In Range("B1:B10") ' Serial numbers to look for in column A
Set foundSerial = Range("A1:A1000").Find( cell address of the serial number I'm looking for +i)
If foundSerial Is Nothing Then
Cells(i, 3).Value = "Not Found"
Else
Cells(i, 3). Value = foundSerial.Address
End If
i = i + 1
Next