View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Open file Dialog box in Macro

Hi Joshua,

Help has a great example

fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen < False Then
workbooks.Open filename:= fileToOpen
End If
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Joshua" wrote in message
...
Ok, I'll do my best to explain what my problem is. I have
a macro that I run to import a text file, format it, sort
it and manipulate the workbook in a few other ways. My
problem comes in that the file's name is not always the
same so I don't want to hardcode the filename into it. I
want instead to have a "Browse" dialog box pop up and the
user be able to select a file to open for the macro to
use. Any help is greatly appreciated. Let me know if
there's something I can help clear up for you.

Joshua Dunn