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.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
.
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.)
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0
Glad it's sorted & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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