i have a code that vlookups an ID number and brings in a name from a different sheet.
However some of the rows are blank, as in no ID number - or they have two IDs in one cell
How do i insert an error handing code to skip blank rows or unrecognised values?
this is my current code.
Sub vlookup()
For i = 2 to 300
Sheets("test1").Cells(i,34).Value=Application.WorksheetsFunction.vlookup _
(Sheets("test1").Cells(i,33).Value,Sheets("test2").range("A:H"),7, False)
Next
End Sub
However some of the rows are blank, as in no ID number - or they have two IDs in one cell
How do i insert an error handing code to skip blank rows or unrecognised values?
this is my current code.
Sub vlookup()
For i = 2 to 300
Sheets("test1").Cells(i,34).Value=Application.WorksheetsFunction.vlookup _
(Sheets("test1").Cells(i,33).Value,Sheets("test2").range("A:H"),7, False)
Next
End Sub