Macro that opens files with differing extensions

V

vrzimmerm

I've got a macro that currently prompts the user to open a .CSV file.
The command I use for this is:

FName = Application.GetOpenFilename("Excel Files (*.csv),*.csv")

This command only displays .CSV files in the "open" window that's
displayed to the user. I'd like to alter this somewhat so that the
user can open more than just .csv files. I'd like for it to list
the .txt and .xls files as well. What would the adjusted
GetOpenFilename command look like for this?

Many thanks.
 
D

Dave Peterson

VBA's help is pretty good for this:

Dim FName As Variant
FName = Application.GetOpenFilename("Text Files, *.csv;*.txt")
 

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