Hi,
I have a button which when clicked runs the below code to allow you to browse for and open a file:
Sub TestIt()
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please select a file")
If NewFN = False Then
' They pressed Cancel
MsgBox "Stopping because you did not select a file"
Exit Sub
Else
Workbooks.Open Filename:=NewFN
End If
End Sub
Works great but I then need to open that file in the current workbook (e.g. Import a worksheet from that book into my macro enabled workbook).
How can I do this?
Many thanks
I have a button which when clicked runs the below code to allow you to browse for and open a file:
Sub TestIt()
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please select a file")
If NewFN = False Then
' They pressed Cancel
MsgBox "Stopping because you did not select a file"
Exit Sub
Else
Workbooks.Open Filename:=NewFN
End If
End Sub
Works great but I then need to open that file in the current workbook (e.g. Import a worksheet from that book into my macro enabled workbook).
How can I do this?
Many thanks