Open a Workbook

J

Jeff

Hello,

I need to create a VBA macro to will allow to select and open a workbook to
activate it.
The name of the workbook will change. The name cannot be fixed.
Thanks,
 
N

Nick Hodge

Jeff

Something like this will work...displays Excel's open dialog, stores the
file selected and opens the workbook

Sub OpenWorkbok()
Dim fName As String
fName = Application.GetOpenFilename()
Workbooks.Open Filename:=fName
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
 
J

Jeff

Thank you


Nick Hodge said:
Jeff

Something like this will work...displays Excel's open dialog, stores the
file selected and opens the workbook

Sub OpenWorkbok()
Dim fName As String
fName = Application.GetOpenFilename()
Workbooks.Open Filename:=fName
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
 
Top