Hi All,
I'm currently using this code below, but want to set the opening path based on cell A1. How do I incoporate it into the macro?
Also, another scenario, if I want open a file in the same directory as the working file. ie using command ThisWorkbook.path & "\" can it be done...
---------------------------------------------------------------------------------------------------------------------------
FileToOpen = Application.GetOpenFilename _
(Title:="Please choose a file to import", _
FileFilter:="Excel Files *.xls (*.xls),")
If FileToOpen = False Then
MsgBox "No file selected", vbExclamation, "No File"
Exit Sub
Else
Workbooks.Open Filename:=FileToOpen
End If
thanks
I'm currently using this code below, but want to set the opening path based on cell A1. How do I incoporate it into the macro?
Also, another scenario, if I want open a file in the same directory as the working file. ie using command ThisWorkbook.path & "\" can it be done...
---------------------------------------------------------------------------------------------------------------------------
FileToOpen = Application.GetOpenFilename _
(Title:="Please choose a file to import", _
FileFilter:="Excel Files *.xls (*.xls),")
If FileToOpen = False Then
MsgBox "No file selected", vbExclamation, "No File"
Exit Sub
Else
Workbooks.Open Filename:=FileToOpen
End If
thanks