Macro that opens files with differing extensions

  • Thread starter Thread starter vrzimmerm
  • Start date Start date
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.
 
VBA's help is pretty good for this:

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