View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
R.VENKATARAMAN R.VENKATARAMAN is offline
external usenet poster
 
Posts: 74
Default Import Data with the filename coming from inputbox ?

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.

Iceage wrote in message
...
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 !@~!!