D
Dave Birley
Here is my initialization of an array:
Dim shtList As Sheets
Set shtList = Worksheets(Array("Earnings Balance 2003 Q4 Page 2", _
"Earnings Balance 2003 Q4", "Earnings Balance 2003 Q3 Page
2", _
"Earnings Balance 2003 Q3", "Earnings Balance 2003 Q2 Page
2", _
"Earnings Balance 2003 Q2", "Earnings Balance 2003 Q1 Page
2", _
"Earnings Balance 2003 Q1", "Earnings Balance 2002 Q4 Page
2", _
"Earnings Balance 2002 Q4", "Earnings Balance 2002 Q3 Page
2")) ', _
"Earnings Balance 2002 Q3", "Earnings Balance 2002 Q2 Page
2", _
"Earnings Balance 2002 Q2", "Earnings Balance 2002 Q1 Page
2", _
"Earnings Balance 2002 Q1", "Earnings Balance 2001 Q4 Page
2", _
"Earnings Balance 2001 Q4", "Earnings Balance 2001 Q3 Page
2", _
"Earnings Balance 2001 Q3", "Earnings Balance 2001 Q2 Page
2", _
"Earnings Balance 2001 Q2", "Earnings Balance 2001 Q1 Page
2", _
"Earnings Balance 2001 Q1", "Earnings Balance 2000 Q4 Page
2", _
"Earnings Balance 2000 Q4", "Earnings Balance 2000 Q3 Page
2", _
"Earnings Balance 2000 Q3", "Earnings Balance 2000 Q2 Page
2", _
"Earnings Balance 2000 Q2", "Earnings Balance 2000 Q1"))
Note the commenting out after element 11. If I move that commenting element
down one row, I get a "Subscript out of range" error, whereas in the form
here I do not get the error. As I need to get all 31 elements into the array
short of doing:
Dim shtList(1 To 31) As Sheets
shtList(1) = Sheets("Earnings Balance 2003 Q4 Page 2")
shtList(2) = Sheets("Earnings Balance 2003 Q4")
....
shtList(31) = Sheets("Earnings Balance 2000")
What is it that I should be doing?
Dim shtList As Sheets
Set shtList = Worksheets(Array("Earnings Balance 2003 Q4 Page 2", _
"Earnings Balance 2003 Q4", "Earnings Balance 2003 Q3 Page
2", _
"Earnings Balance 2003 Q3", "Earnings Balance 2003 Q2 Page
2", _
"Earnings Balance 2003 Q2", "Earnings Balance 2003 Q1 Page
2", _
"Earnings Balance 2003 Q1", "Earnings Balance 2002 Q4 Page
2", _
"Earnings Balance 2002 Q4", "Earnings Balance 2002 Q3 Page
2")) ', _
"Earnings Balance 2002 Q3", "Earnings Balance 2002 Q2 Page
2", _
"Earnings Balance 2002 Q2", "Earnings Balance 2002 Q1 Page
2", _
"Earnings Balance 2002 Q1", "Earnings Balance 2001 Q4 Page
2", _
"Earnings Balance 2001 Q4", "Earnings Balance 2001 Q3 Page
2", _
"Earnings Balance 2001 Q3", "Earnings Balance 2001 Q2 Page
2", _
"Earnings Balance 2001 Q2", "Earnings Balance 2001 Q1 Page
2", _
"Earnings Balance 2001 Q1", "Earnings Balance 2000 Q4 Page
2", _
"Earnings Balance 2000 Q4", "Earnings Balance 2000 Q3 Page
2", _
"Earnings Balance 2000 Q3", "Earnings Balance 2000 Q2 Page
2", _
"Earnings Balance 2000 Q2", "Earnings Balance 2000 Q1"))
Note the commenting out after element 11. If I move that commenting element
down one row, I get a "Subscript out of range" error, whereas in the form
here I do not get the error. As I need to get all 31 elements into the array
short of doing:
Dim shtList(1 To 31) As Sheets
shtList(1) = Sheets("Earnings Balance 2003 Q4 Page 2")
shtList(2) = Sheets("Earnings Balance 2003 Q4")
....
shtList(31) = Sheets("Earnings Balance 2000")
What is it that I should be doing?