Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
first time array help
trying to use array to define 9 sheets tabs for sheets Nbr 1-9
cannot get pass following. Dim ws As Worksheets For Each ws In ThisWorkbook.Worksheets(Array("sheet1", "sheet2", "sheet3", "sheet4", "sheet5", "sheet6", "sheet7", "sheet8", "sheet9")) for each yellows out code here for print area and nbr copies is it to many sheets does array have limits build these sheets then want to print out of all at same time. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
first time array help
Curt,
here is a way to create 9 sheets Sub Curt() Dim i As Long For i = 1 To 9 Sheets.Add ActiveSheet.Name = "Nbr" & i Next i End Sub Here is a way to print the array Sheets (Array ("Nbr1", "Nbr2", "Nbr3", "Nbr4", "Nbr5", "Nbr6", "Nbr7", "Nbr8" ,"Nbr9" )).Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True "Curt" wrote: trying to use array to define 9 sheets tabs for sheets Nbr 1-9 cannot get pass following. Dim ws As Worksheets For Each ws In ThisWorkbook.Worksheets(Array("sheet1", "sheet2", "sheet3", "sheet4", "sheet5", "sheet6", "sheet7", "sheet8", "sheet9")) for each yellows out code here for print area and nbr copies is it to many sheets does array have limits build these sheets then want to print out of all at same time. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
first time array help
maybe something like this:
Sub test() Dim shArray As Variant Dim i As Variant shArray = Array("sheet1", "sheet2", "sheet3", _ "sheet4", "sheet5", "sheet6", "sheet7", "sheet8", "sheet9") For Each i In shArray Worksheets(i).Activate Next End Sub -- Gary "Curt" wrote in message ... trying to use array to define 9 sheets tabs for sheets Nbr 1-9 cannot get pass following. Dim ws As Worksheets For Each ws In ThisWorkbook.Worksheets(Array("sheet1", "sheet2", "sheet3", "sheet4", "sheet5", "sheet6", "sheet7", "sheet8", "sheet9")) for each yellows out code here for print area and nbr copies is it to many sheets does array have limits build these sheets then want to print out of all at same time. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
first time array help
If your sheets are all named nicely, you could rely on that, too:
dim wCtr as long for wctr = 1 to 9 with worksheets("sheet" & wctr) 'code to do your print area and number of copies 'and print each sheet one at a time. end with next wctr Curt wrote: trying to use array to define 9 sheets tabs for sheets Nbr 1-9 cannot get pass following. Dim ws As Worksheets For Each ws In ThisWorkbook.Worksheets(Array("sheet1", "sheet2", "sheet3", "sheet4", "sheet5", "sheet6", "sheet7", "sheet8", "sheet9")) for each yellows out code here for print area and nbr copies is it to many sheets does array have limits build these sheets then want to print out of all at same time. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Time array | New Users to Excel | |||
Time array | Excel Worksheet Functions | |||
Time array | Excel Programming | |||
FILL ARRAY ONE ROW AT A TIME | Excel Programming | |||
How to activate array formulas in a range of cells all at the same time? | Excel Programming |