Error With Vlookup Formula?

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Is anyone able to provide me a set of educated eyes to reveal the problem in the highlighted code below that is chirping an "Application-deined or object-defined error".

Rich (BB code):
            With ws_thold 'the list
                '.Cells(d_th, 28) = posnum
                .Cells(d_th, 29) = x
                .Cells(d_th, 30) = pnum
                .Cells(d_ht, 31) = "=VLookup(""" & pnum & """,'D:\WSOP 2020\[permit_data.xlsx]Permit_Data'!A:S,5,false)" 'function(5)
                .Cells(d_ht, 32) = "=VLookup(""" & pnum & """,'D:\WSOP 2020\[permit_data.xlsx]Permit_Data'!A:S,12,false)" 'base dist(12)
                .Cells(d_ht, 33) = "=VLookup(""" & pnum & """,'D:\WSOP 2020\[permit_data.xlsx]Permit_Data'!A:S,19,false)" 'pitch dist(19)
                .Cells(d_th, 26) = bkg_st
                .Cells(d_th, 27) = bkg_et
                d_th = d_th + 1
            End With

pnum = R2685 and is found in closed workbook permit_data.xlsx, worksheet Permit data, cell A10. The value in F10 is "Hockey"
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
The easiest way of trying to find errors when you are writing equations to the worksheet is to remove the equals sign from the start of the string you are writing to the cell, this means it just writes a string not an equation. Then run the macro, then go to the cell and add the equals sign back in, excel will then tell you wherethe error is.
 
Upvote 0
Thank you offthelip for that suggestion. It helped me realize the issue wasn't in the formula, it was in the destination.
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,352
Members
449,080
Latest member
Armadillos

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