VBA Vlookup Formula MultiWorkbook

Eudezet

New Member
Joined
May 25, 2015
Messages
1
Dear Colleagues,

Using VBA I would like to search for values in other workbook using vlookup function. Others workbook name is not fixed, therefore I define variable string PYDN.

The problem is that if I change in code below file name to PYDN excel opens window and asks to choose a file.

Code:

Dim PYDN as string
PYDN = "Cloud.xlsx"

Range("I69").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-8],'[PYDN]SAPBW70_DOWNLOAD'!R69C1:R1651C7,5,0)"

How can I solve it? Please suggest.

Thank you!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,203,234
Messages
6,054,276
Members
444,714
Latest member
excel2782

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