Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time array Richard New Users to Excel 6 March 15th 07 04:37 PM
Time array Richard Excel Worksheet Functions 6 March 15th 07 04:37 PM
Time array Richard Excel Programming 6 March 15th 07 04:37 PM
FILL ARRAY ONE ROW AT A TIME [email protected] Excel Programming 3 August 25th 06 09:52 PM
How to activate array formulas in a range of cells all at the same time? Karenna Excel Programming 3 February 29th 04 11:30 PM


All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"