Import Data with the filename coming from inputbox ?

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

Guest

Anyone has a marco that could help me to import the Data with the filename
coming from a inputbox ? The Data file and the excel file is in the same
folder. My excel already has a function to open new workbook and the data is
to be loaded into the new work book. Everything is good except the part of
calling the data file with the file name coming from the inputbox.

Do i need to change the string to text ??

Any marcos that could help ??

Thanx in advance !@~!!
 
try this if the other file is in the same folder

Public Sub test()
Dim file As String
file = InputBox("type the name of the file with extension")
Workbooks.Open (file)

End Sub
if the file is in the same folder it is enough to give input only finlename
and extension otherwise the whole path.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top