Runtime Error 1004 - Using VLOOKUP in VBA (COMPLETED)

ReggaeYT

New Member
Joined
Jul 24, 2014
Messages
12
Running a very basic test code to try out on a large amount of data, but having trouble, getting the "1004" error.

Sub HugeSort()
Dim c As Integer


'LOOPS THROUGH ALL ROWS
For c = 2 To 10

If IsEmpty(ActiveSheet.Cells(c, 1)) = False Then
ActiveSheet.Cells(c, 2) = Application.WorksheetFunction.VLookup(ActiveSheet.Cells(c, 1), Sheets("HALB").Range("A:B"), 2, 0)
End If
Next c


End Sub


Brief explanation: I've created a helper column (column 1) in 2 spreadsheets, and am now trying to VLOOKUP to transfer the data over from 1 to the other. Ran through 10000 lines and had no "1004" error in generating those helper numbers, but as soon as the VLOOKUP component was added, I can't get past this error. Thanks in advance for any help!
 
Last edited:

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

ReggaeYT

New Member
Joined
Jul 24, 2014
Messages
12
Re: Runtime Error 1004 - Using VLOOKUP in VBA

One other note: sometimes the error is "Unable to get the VLookup property of the WorksheetFunction class"
 

Watch MrExcel Video

Forum statistics

Threads
1,090,131
Messages
5,412,637
Members
403,436
Latest member
surbharti

This Week's Hot Topics

Top