Vlookup to unopened sheet

sand112281

Board Regular
Joined
Aug 6, 2004
Messages
75
I am running a macro that does a vlookup into a sheet that is unopened. when i run this macro the cells that ran the vlookup show #NAME?. when i click inside the cell and the end of the formula and hit enter the cell executes the vlookup and shows the number. what is going on that the vlookup formula will not work unless i go in and adjust it and how can i fix this?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Maybe a look at the formula could help us?
 
Upvote 0
it is very long but here you go.

Range("f12").FormulaR1C1 = "=VLOOKUP(RC[-3],'J:\ZISG EQUITY TEAM\DJ CDA Daily\" & trade_year & " CDA Daily\" & trade_year & "-" & cda_trade_month & "\[cda" & trade_year & "" & cda_trade_month & "" & cda_trade_day & ".xls]cda" & trade_year & "" & cda_trade_month & "" & cda_trade_day & "'!J:AR,35,FALSE)"

all of the variables are added through input boxes.
 
Upvote 0
i have looked it over a bunch of times but i cant seem to figure out why it gives me #NAME? but when i click in the cell at the end of the formula it works.
 
Upvote 0
You have FormulaR1C1 and J:AR which are 2 different formula systems.
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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