Run-time Error '1004' Unable to Get Vlookup Property

Barklie

Board Regular
Joined
Jul 4, 2013
Messages
86
Hi all,
I am trying to create a macro that will cross reference two lists and return the matches across the list. The problem is that the Vlookup function isn't properly working even though I know the variables in it are properly set (I copied and pasted them with VBA to make sure this wasn't the problem). Other advice online says to use On Error Resume Next in case the Vlookup isn't returning a match, but I know that the value its searching is in the table so this fix isn't working for me. Here is my code:
Code:
Sub xpt4()
Dim FindUI As String
Dim etRange As Range
FindUI = ActiveSheet.Previous.Cells(7, "AJ")
Set etRange = Workbooks("Estimation_Tools_May.xml").Worksheets("ms_tools").Range("$I$1:$W$163")
i = 2
    Do While ActiveSheet.Previous.Range("A" & i) <> ""
        Cells(i, 1) = WorksheetFunction.VLookup(FindUI, etRange, 1, False)
            i = i + 1
    Loop
End Sub

Thanks for looking!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,215,095
Messages
6,123,072
Members
449,093
Latest member
ripvw

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