VBA Vlookup a file

DataBlake

Well-known Member
Joined
Jan 26, 2015
Messages
781
Office Version
  1. 2016
Platform
  1. Windows
I know this has probably been answered a bajillion times but i cant find what i'm looking for on google.
I want to vlookup another workbook (only contains 1 sheet) so i have this

Code:
Range("R2").Select
    ActiveCell.FormulaR1C1 = _
        "=VLOOKUP(RC[-17],[MHTqty.xlsx]Item!R1:R1048576,3,FALSE)"
    lastRow = Range("A" & Rows.Count).End(xlUp).Row

but i want the workbook portion to prompt a window to select a file. like when you need to update a reference.
sometimes it does it sometimes it doesnt.
 
To know the name of the pages of a closed book, it can be achieved in 2 ways.

The first one is opening the book.
The second is creating a connection and requires the excel version, and that is always a problem to identify the excel version.

If you do not want to open the book, then you will have to use option 2.


You can follow the following thread:
https://www.mrexcel.com/forum/excel-questions/266703-retrieve-all-sheet-names-closed-workbook.html

thanks i will go with option 2 and follow that thread
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,223,908
Messages
6,175,304
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