Can I create a macro that would go to the C: Drive and allow me to pick a
file and open it. I want to be able to choose the file after I hit the macro
button.
--
Gary Baker
Can I create a macro that would go to the C: Drive and allow me to pick a
file and open it. I want to be able to choose the file after I hit the macro
button.
--
Gary Baker
Gary
The code below, throws the standard Open File dialog, allows you to find the
file, clicking OK captures the name in the variable fName, but does not open
it. The next line does that, using the name in the variable to identify the
file to open
Sub OpenFile()
Dim fName As String
fName = Application.GetOpenFilename()
Workbooks.Open Filename:=fName
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]HIS
"GWB Direct" <[email protected]> wrote in message
news:[email protected]...
> Can I create a macro that would go to the C: Drive and allow me to pick a
> file and open it. I want to be able to choose the file after I hit the
> macro
> button.
> --
> Gary Baker
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks