LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Marco de Witte
 
Posts: n/a
Default printing an array of worksheets

I have an excel-file with a lot of worksheets in it, and I would like to
print only a few of them (in my case: from the first sheet to a sheet named
"btw").

I have the following code (selection made manually):

Sub TestPrint()
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Voorblad").Select
Sheets(Array("Voorblad", "Inhoudsopgave", "Opdracht", "res", "fin",
"liq", "balans", _
"V&W", "kosten", "Grondslagen", "vaste_act", "fin_act", "vl_act",
"liq midd", "ev", _
"pass lang", "pass kort", "btw")).Select
Sheets("Voorblad").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

But if there's a worksheet added, it will not be in the array.

And I have another code, selecting everything from the first sheet to the
sheet "btw", but it doesn't print the page-numbering allright (and with the
first code is does that allright):

Sub PrintenJaarrapport()

Dim S As Worksheet

For Each S In Worksheets
S.Select
If S.Name = "rekenblad" Then
Exit Sub
End If
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
'Selection.PrintOut Copies:=1, Collate:=True
'ActiveWindow.SelectedSheets.PrintPreview
Next S
Worksheets("Inhoudsopgave").Activate

End Sub


Is there someone who can help me with this problem?

Thanks, Marco.
 
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
data entry on multiple worksheets diosdias Excel Discussion (Misc queries) 1 December 7th 04 05:33 PM
Linked worksheets John Kelly Excel Discussion (Misc queries) 1 December 2nd 04 12:36 AM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM
Enable Double sided printing contiuously when printing multiple s. Lee Excel Discussion (Misc queries) 1 November 27th 04 01:58 AM


All times are GMT +1. The time now is 10:22 PM.

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

About Us

"It's about Microsoft Excel"