File Open (via browse) and then run my recorded macro

K

Kolz

Rookie I am ...

I record macros ever now and then ... good at hitting the record button...

But, now i want to know how to program a macro to 1st locate the file via
browse, then paste in my recorded macro.

What is the code to prompt a file, browse, open ? and then how should I
integrate that into my recorded macro.

Thanks in advance for your help
 
J

Jacob Skaria

Dim strFile as String

With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Filters.Add "My Files", "*.xls", 1
.InitialFileName = "C:\"
.Show
strFile = .SelectedItems(1)
End With

If this post helps click Yes
 

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

Top