Run Time error 1004: Unable to get the vlookup property of the worksheet function class

kavkazi

New Member
Joined
May 6, 2010
Messages
11
Hello,

I am trying to do a vlookup on current worksheet compared to a range in another file.

I get a "Run Time Error 1004: Unable to get the vlookup property of the worksheet function class".

After some investigation, I found out that if there are some values that dont match up this could be a problem. In my case I will run into that situiation. But for testing purposes, I tried manipulating the data so that this doesnt happen. With no luck.

Here is my code:

Code:
Dim lastrow as Long

lastrow = Sheets("Master List").Range("A1").End(xlDown).Row

For i = 2 To lastrow
Sheets("Master List").Cells(i, "B").Value = Application.WorksheetFunction.VLookup(Sheets("Master List").Cells(i, "A"), "'T:\Operations+Technology\NOC\Abuse Emails\[Customer Data for Abuse Emails.xls]Report'!$E$4:$G$60000", 2, False)
Next i

Thanks in Advance
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
When using worksheet functions with VBA we have to use VBA syntax, so a general solution would be like :-

Code:
x = Application.WorksheetFunction.VLookup("test", _
    Workbooks("Book1.xls").Worksheets("Sheet1").Range("A1:B10"), 2, False)

The source workbook has to be open.
No path in the file name.

The code in your message is difficult to read. In your own interest, the clearer your message is the more likely you are to get a reply. Please note how I have achieved that.
 
Upvote 0

Forum statistics

Threads
1,212,934
Messages
6,110,760
Members
448,295
Latest member
Uzair Tahir Khan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top