Hi All,
I have been using the below code and it is working absolutely fine...
But, I think the code is repetitive and is there any way to reduce this vlookup code by better referencing method... I tried diff methods but it is giving me errors... Dunno how can I make this code better and smaller. Please help.
Can it be made to a single referencing code?
The R18,R59,R87 and R110 has formula in that cell...so cannot use the same vlookup for those cells...
With Range("R4:R17")
.Value = WorksheetFunction.VLookup(Range("B4:B17"), Worksheets("Placeholder").Range("C2:F202"), 4, False)
On Error Resume Next
.SpecialCells(xlCellTypeConstants, xlErrors).Value = 0
On Error GoTo 0
End With
With Range("R19:R58")
.Value = WorksheetFunction.VLookup(Range("B19:B58"), Worksheets("Placeholder").Range("C2:F202"), 4, False)
On Error Resume Next
.SpecialCells(xlCellTypeConstants, xlErrors).Value = 0
On Error GoTo 0
End With
With Range("R60:R86")
.Value = WorksheetFunction.VLookup(Range("B60:B86"), Worksheets("Placeholder").Range("C2:F202"), 4, False)
On Error Resume Next
.SpecialCells(xlCellTypeConstants, xlErrors).Value = 0
On Error GoTo 0
End With
With Range("R88:R109")
.Value = WorksheetFunction.VLookup(Range("B88:B109"), Worksheets("Placeholder").Range("C2:F202"), 4, False)
On Error Resume Next
.SpecialCells(xlCellTypeConstants, xlErrors).Value = 0
On Error GoTo 0
End With
Bookmarks