View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dan E[_2_] Dan E[_2_] is offline
external usenet poster
 
Posts: 102
Default Any way to grab a .csv file from a folder using Wildcards

David,

You can use
inFile = Application.GetOpenFilename
which will open a standard "Open" file dialog box to browse for your .csv
file and returns a file name and path
ie (inFile = "C:\My Documents\MyCSV.csv")

Dan E

"David Johnston" wrote in message
om...
Does anyone know of a way that I can grab a .csv file out of a local
folder with out specifying the exact document. I have created a macro
that can take the CSV data and import into the Excel worksheet save it
and print it but only if I code it to that exact CSV document. I was
hoping to be able to just have it grab any CSV document in a
particular folder. There will be only one CSV document at anytime in
the folder but it will not always be named the same. Any ideas.