View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Greg Koppel Greg Koppel is offline
external usenet poster
 
Posts: 79
Default opening and closing files in order with vba

Hi Shane,

myFile = Dir(" path to the first file in the folder... \FirstFile.xls")
Do Until myFile=""
perform the operations on myFile
myFile=Dir() NOTE: Do not include the path to the folder here
Loop

HTH, Greg

"shane" wrote in message
...
I am wanting to open and close a excel file named PS 01-01-98 through PS

01-01-2004 in order and extract data from each file untill I reach the last
file. I already have the code written to extract the data, but am not sure
how to open the next filename in order. Any help would be greatly
appreciated.
thanks, shane