beartooth91
Board Regular
- Joined
- Dec 15, 2024
- Messages
- 64
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
The below vba works.
The result is I have 6+ open workbooks that I want to copy out of. Is there a **simple** vba way to reference the open workbooks, either by number or name? The number of workbooks - which I will have to routinely copy out of - dynamically grows and shrinks, but will probably have 30+ workbooks to copy out of as this project moves along.
VBA Code:
Sub Open_WB()
' Opens each workbook in the Standard-Format IO Lists subfolder
Dim SfFolder As String, SfList As String
SfFolder = Dir(ThisWorkbook.Path & "/Standard-Format IO Lists")
SfList = Dir(ThisWorkbook.Path & "/Standard-Format IO Lists" & "\*.xlsx")
Do While SfList <> ""
Workbooks.Open FileName:=ThisWorkbook.Path & "/Standard-Format IO Lists" & "\" & SfList
SfList = Dir
Loop
End Sub