run time error 1004

xzaqus

New Member
Joined
Sep 24, 2017
Messages
33
I can't seem to figure out why I am getting the runtime error 1004 (Application defined or object defined error)

For iRow = 2 To lrow
wsA.Cells(iRow, IDcol + 2) = WorksheetFunction.VLookup(wsA.Cells(iRow, IDcol + 1), wsB.Range("$A$1:$D$3000"), 3, False)
Next iRow



Thanks.
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
3,575
.
It would be best if you posted your entire code, and specify where the error is highlighting.

Having a sample workbook with your code is the best method. You could post it on a cloud site for review (DropBox, Google, Amazon Cloud, etc.)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,134
Office Version
  1. 365
Platform
  1. Windows
It would help if you could post the entire code.
What are lrow, IDcol, wsA & wsB
Also are you sure that the value exists in col A of your lookup range?
 

xzaqus

New Member
Joined
Sep 24, 2017
Messages
33
Hello all,

It was due to N/A results from the vlookup. Corrected the issue with on error resume next.

Thank you for looking into this.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,134
Office Version
  1. 365
Platform
  1. Windows
Glad it's sorted & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,108,732
Messages
5,524,513
Members
409,583
Latest member
RedHelp

This Week's Hot Topics

Top