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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

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