I am writing a simple code to loop through a row of data. I have a for loop that goes from one cell to anohter. When vlookup reach a cell where there is not value, the macro stops there. How can I skip to the next vLoopUp action? If iRow 3 has an error, skip to iRow 4.
For iRow = 2 To 5
sLookUpValue = Worksheets("Item").Range(sDeptColumnLetter & iRow).Value
sResult = Application.VLookup((sLookUpValue), Worksheets("Department").Range("A1:D200"), 4, False)
Worksheets("Item").Range(sDeptColumnLetter & iRow) = sResult
Next iRow
For iRow = 2 To 5
sLookUpValue = Worksheets("Item").Range(sDeptColumnLetter & iRow).Value
sResult = Application.VLookup((sLookUpValue), Worksheets("Department").Range("A1:D200"), 4, False)
Worksheets("Item").Range(sDeptColumnLetter & iRow) = sResult
Next iRow