How to ask user for file to open

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a template that I am putting a macro that will load data from another spreadsheet. However, I do not know what the other spreadsheet name will be. How can I ask the user to open the spreadsheet that contains the data

Thank

Dwaine Horto
York International
 
Dwain

one way is to use an inputbox to request the information from the user. Something like
filetoget = InputBox("Enter the name of the file to open.", , "c:\temp\filetoopen.xls"

This will give a variable with the filename (including path if required) which can then be used to open the file
Workbooks.Open FileName:=filetoge

Ton

----- Dwaine Horton wrote: ----

I have a template that I am putting a macro that will load data from another spreadsheet. However, I do not know what the other spreadsheet name will be. How can I ask the user to open the spreadsheet that contains the data

Thank

Dwaine Horto
York International
 
Back
Top