PDA

View Full Version : Vlookup Error



rockybalboa
06-09-2014, 10:48 PM
Hi,

I get this error "unable to get vlookup property of worksheetfunction class" when i use the below code. Can somebody please help



recNum5 = 2
Do Until wb5.Sheets("Notes").Range("B" & recNum5) = ""
lookup_value = wb5.Sheets("Notes").Range("B" & recNum5).Value
path = wb4.Sheets("Report1").Range("E3:H2000")
On Error GoTo MyError:
x = WorksheetFunction.VLookup(lookup_value, path, 4, False) ---- Get error here
wb5.Sheets("Notes").Range("P" & recNum5).Value = x
MyError:
If Err.Number = 1004 Then wb5.Sheets("Notes").Range("P" & recNum5).Value = "NR"
recNum5 = recNum5 + 1
Loop

Bob Phillips
06-10-2014, 02:42 AM
Can't see why. Can you post your workbook?

rockybalboa
06-10-2014, 03:14 AM
It runs for the first lookup value but then gives error for second

Bob Phillips
06-10-2014, 04:36 AM
Can't see why. Can you post your workbook?