Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I stop blank workbook from opening when opening an existing | Excel Discussion (Misc queries) | |||
How do I number cells vertically in succession? Example: (1 2 3) | Excel Worksheet Functions | |||
Open multiple HTML files in succession | Excel Programming | |||
Macro to query data from a succession of websites and display in seperate sheets | Excel Programming | |||
excel VBA problem - setting workbook as variable & opening/re-opening | Excel Programming |