Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Opening a Succession

Workbooks.OpenText FILENAME:= _
"C:\JDIS_FILES\PURGRPT_" & "*.jdis"


This opens the file in the directory I want to be opened. However my
question is:
If there are say 10 reports with that prefix and suffix in that direcory, is
there a way I can have a macro open the first one, then the next one, then
the next one etc. On down the line until the last one then stop?

Does that make sense?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Opening a Succession


First = True
Do while (1)
if First = True then
MyFilename = Dir("C:\JDIS_FILES\PURGRPT_" & "*.jdis")
First = False
else
MyFileName = Dir()
end if

if MyFilename = "" then exit do
Workbooks.OpenText FILENAME:= MyFileName
loop

"bodhisatvaofboogie" wrote:

Workbooks.OpenText FILENAME:= _
"C:\JDIS_FILES\PURGRPT_" & "*.jdis"


This opens the file in the directory I want to be opened. However my
question is:
If there are say 10 reports with that prefix and suffix in that direcory, is
there a way I can have a macro open the first one, then the next one, then
the next one etc. On down the line until the last one then stop?

Does that make sense?

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
How do I stop blank workbook from opening when opening an existing kjg Excel Discussion (Misc queries) 3 February 12th 10 09:36 PM
How do I number cells vertically in succession? Example: (1 2 3) rsmith844 Excel Worksheet Functions 4 October 2nd 07 02:04 PM
Open multiple HTML files in succession Gil Excel Programming 3 July 22nd 05 08:36 PM
Macro to query data from a succession of websites and display in seperate sheets DrSues02 Excel Programming 1 October 20th 04 09:22 PM
excel VBA problem - setting workbook as variable & opening/re-opening safe Excel Programming 1 August 20th 04 12:22 AM


All times are GMT +1. The time now is 09:18 AM.

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"