Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Here is an idea for the second question: Option Explicit Public Sub LoopFiles() Dim sStart As String ' sStart = InputBox("Where to start", "Find Files in folder", "C:\My Documents") loopTree (sStart) End Sub Private Sub loopTree(ByVal sStart As String) Dim sFound As String ' sFound = Dir(sStart & "\*.*") Do While sFound < "" If (GetAttr(sStart & "\" & sFound) And vbDirectory) = vbDirectory Then loopTree (sStart & "\" & sFound) Else Debug.Print sStart & "\" & sFound End If sFound = Dir() Loop End Sub Good Luck, Wouter HM. "Bob Phillips" wrote in message ... For Each WB In Workbooks Debug.Print WB.Name Next WB -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Dan" wrote in message ... Hello What code would I use to loop through all open workbooks, or all files in a dir names filex****. Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF wokkbook1 is open, open workbook2 Loop | Excel Programming | |||
Loop with two workbooks | Excel Programming | |||
loop through workbooks | Excel Programming | |||
loop through workbooks | Excel Programming | |||
Can I have a loop to open a set of workbooks get some data, close it one a time. | Excel Programming |