Select File to Open

  • Thread starter Thread starter CrimsonPlague29
  • Start date Start date
C

CrimsonPlague29

Hello,

I'm looking for a code that when the user runs the macro it prompts them to
select the file which they want to open ???


Thanks
 
Option Explicit
Sub testme01()

Dim myFileName As Variant

myFileName = Application.GetOpenFilename("Excel Files, *.xls")

If myFileName = False Then
Exit Sub
End If

'your code to open that file and do what you want.
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top