Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default opening and closing files in order with vba

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
order of opening files with sumproduct returning #REF! sharon p Excel Worksheet Functions 2 September 15th 09 05:29 PM
OPENING AND CLOSING OF EXCEL 07 FILES hot-rod-3 Excel Discussion (Misc queries) 2 July 23rd 09 12:30 AM
Excel 2003/2007 Crash when opening/closing files Richard NYC Excel Discussion (Misc queries) 1 October 18th 07 08:22 AM
Opening and closing workbook with VBA... Trevor[_4_] Excel Programming 1 March 4th 04 08:33 PM
Opening and closing text files Vince[_3_] Excel Programming 1 August 11th 03 09:43 PM


All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"