I am trying to have several arrays of my worksheets that I can call up in my code using.
ThisWorkbook.Sheets(Array(\"Sheet1\", \"Sheet3\"))
ThisWorkbook.Shee
I had a similar problem trying to create a dynamic array (not knowing how many sheets there was for me to deal with). I simply used this:
Sub copyArrayOfSheets()
Dim loopArray() As Variant
ReDim Preserve loopArray(1 To 1)
loopArray(1) = "Sheet1" ' a Sheet I know I need to export
j = 1
For Each loopSheet In ThisWorkbook.Sheets
If loopSheet.Name <> "Sheet1" Then
theName = loopSheet.Name
j = j + 1
ReDim Preserve loopArray(1 To j)
loopArray(j) = theName ' Assign the name of the sheets to j-th position of loopArray()
End If
Next loopSheet
Sheets(loopArray()).Copy
Set newBook = ActiveWorkbook
newBook.Activate
End Sub
Hope this helps in any way...