scottclayton
New Member
- Joined
- Apr 20, 2014
- Messages
- 8
Hello Excel Folks,
I'm trying to tell Excel to select sheets that are named in a cell—e.g. cell A1's value is:
"Sheet1", "Sheet2", "Sheet4"
I want Excel to do the equivalent of me clicking Sheet1 and holding ctrl while clicking Sheet2 and Sheet4. I can't do something as simple as
Sub SelectingSheets()
'
' SelectingSheets Macro
'
'
Sheets(Array(Range("A1").Value)).Select
End Sub
because then I get a "subscript out of range" error.
Anyone have any ideas? Thanks in advance. I'm probably missing something super obvious.
I'm ultimately trying to print only certain sheets. In my real-world example I'll have at least 35 sheets in my workbook, but only a handful might need to be printed, but that handful will be changing all the time—(and the cell will update as needed, which is easy enough).
I'm trying to tell Excel to select sheets that are named in a cell—e.g. cell A1's value is:
"Sheet1", "Sheet2", "Sheet4"
I want Excel to do the equivalent of me clicking Sheet1 and holding ctrl while clicking Sheet2 and Sheet4. I can't do something as simple as
Sub SelectingSheets()
'
' SelectingSheets Macro
'
'
Sheets(Array(Range("A1").Value)).Select
End Sub
because then I get a "subscript out of range" error.
Anyone have any ideas? Thanks in advance. I'm probably missing something super obvious.
I'm ultimately trying to print only certain sheets. In my real-world example I'll have at least 35 sheets in my workbook, but only a handful might need to be printed, but that handful will be changing all the time—(and the cell will update as needed, which is easy enough).