LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Printing Grouped Sheets

Hi there....I'm working on creating a macro in Excel 2000 to be able to print grouped sheets. It works fine when I record it, but when I play it back I always only get one sheet - not all the grouped sheets.

This is the code I am using....can you tell me how to make it work? Do I somehow need to combine the selected sheet info and the selected range and how do I do that

The code to select it works well and the code to print works well, just not together.

Sub PrintAllPayStubs(

Dim sh As Objec
Dim shArr() As Strin
Dim FirstSheet As Objec
Dim LastSheet As Objec

Set FirstSheet = Sheets("aa"
Set LastSheet = Sheets("zz"

ReDim shArr(FirstSheet.Index To LastSheet.Index

For Each sh In ThisWorkbook.Sheet
If sh.Index = FirstSheet.Index And sh.Index <= LastSheet.Index The
shArr(sh.Index) = sh.Nam
End I
Next s

Sheets(shArr).Selec

Range("B1:L59").Selec
With ActiveSheet.PageSetu
.LeftHeader = "
.CenterHeader = "
.RightHeader = "
.LeftFooter = "
.CenterFooter = "
.RightFooter = "
.LeftMargin = Application.InchesToPoints(0.5
.RightMargin = Application.InchesToPoints(0.5
.TopMargin = Application.InchesToPoints(1
.BottomMargin = Application.InchesToPoints(1
.HeaderMargin = Application.InchesToPoints(0.5
.FooterMargin = Application.InchesToPoints(0.5
.PrintHeadings = Fals
.PrintGridlines = Fals
.PrintComments = xlPrintNoComment
.PrintQuality = 35
.CenterHorizontally = Fals
.CenterVertically = Fals
.Orientation = xlPortrai
.Draft = Fals
.PaperSize = xlPaperLette
.FirstPageNumber = xlAutomati
.Order = xlDownThenOve
.BlackAndWhite = Fals
.Zoom = 8
End Wit
Selection.PrintOut Copies:=1, Collate:=Tru
Range("A1").Selec
ActiveWindow.ScrollWorkbookTabs Position:=xlFirs
Sheets("Master").Selec
Range("B6").Selec
End Su

Thank






 
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
not printing grouped columns Erol Excel Discussion (Misc queries) 2 May 7th 09 09:31 PM
printing worksheet with cells grouped craig Excel Discussion (Misc queries) 0 September 18th 08 09:46 PM
Printing a group that is not grouped jerminski73 Excel Discussion (Misc queries) 2 May 22nd 07 07:38 PM
Printing Grouped Sheets JMay Excel Programming 3 May 10th 04 11:26 PM
Sheets(array) method for printing grouped worksheets Tom Ogilvy Excel Programming 0 July 17th 03 09:11 PM


All times are GMT +1. The time now is 08:20 PM.

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"