Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheets(array) method for printing grouped worksheets
arySheets(3) is by default arySheets(0 to 3), so you leave arySheets(3)
as empty and that causes the error. Regards, Tom Ogilvy "Keith Bishton" wrote in message ... I often group sheets to print and I am trying to develop a way to automate the process. I am able to add sheet names to a list box, add the selected sheet names in the list box to any array. But when I try to apply the elements of the array using the Sheets(array) method I get a "Subcript out of range" error. For example: Dim arySheets(3) arySheets(0) = "Sheet1" arySheets(1) = "Sheet2" arySheets(2) = "Sheet3" For i = 0 to Ubound(arySheets) Sheets(arySheets(i)).Select 'trying to imitate 'Sheets(Array("Sheet1","Sheet2","Sheet3").Select Next Comments, suggestion, work arounds? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
not printing grouped columns | Excel Discussion (Misc queries) | |||
Printing Footers on Grouped Worksheets | Excel Discussion (Misc queries) | |||
Printing a group that is not grouped | Excel Discussion (Misc queries) | |||
Select sheets from an array for printing | Excel Discussion (Misc queries) | |||
printing an array of worksheets | Excel Discussion (Misc queries) |