ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing Grouped Sheets (https://www.excelbanter.com/excel-programming/297778-printing-grouped-sheets.html)

JMay

Printing Grouped Sheets
 
I have 3 Worksheets which I have "Grouped"
WS01 - has 3 pages of printable stuff
WS02 - has 2 pages of ... stuff
Ws03 - has 1 page

Private Sub Workbook_BeforePrint(Cancel As Boolean)
CellInFooter
End Sub

Public Sub CellInFooter()
ActiveSheet.PageSetup.LeftFooter = Range("A1").Value & Page#
End Sub

Problem? Page# << Not working; Wish for it to print from 1
sequentially to end (page 6). Any help appreciated...





Paulw2k

Printing Grouped Sheets
 
ActiveSheet.PageSetup.LeftFooter = Range("A1").Value & " Page " & "&P"




"JMay" wrote in message
news:6uKnc.16193$nN6.7365@lakeread06...
I have 3 Worksheets which I have "Grouped"
WS01 - has 3 pages of printable stuff
WS02 - has 2 pages of ... stuff
Ws03 - has 1 page

Private Sub Workbook_BeforePrint(Cancel As Boolean)
CellInFooter
End Sub

Public Sub CellInFooter()
ActiveSheet.PageSetup.LeftFooter = Range("A1").Value & Page#
End Sub

Problem? Page# << Not working; Wish for it to print from 1
sequentially to end (page 6). Any help appreciated...







JE McGimpsey

Printing Grouped Sheets
 
One way:


Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSheet As Worksheet
For Each wsSheet In ActiveWindow.SelectedSheets
wsSheet.PageSetup.LeftFooter = _
wsSheet.Range("A1") & " &P"
Next wsSheet
End Sub

See "Formatting Codes for Headers and Footers" in XL/VBA Help for more
codes.

In article <6uKnc.16193$nN6.7365@lakeread06, "JMay"
wrote:

I have 3 Worksheets which I have "Grouped"
WS01 - has 3 pages of printable stuff
WS02 - has 2 pages of ... stuff
Ws03 - has 1 page

Private Sub Workbook_BeforePrint(Cancel As Boolean)
CellInFooter
End Sub

Public Sub CellInFooter()
ActiveSheet.PageSetup.LeftFooter = Range("A1").Value & Page#
End Sub

Problem? Page# << Not working; Wish for it to print from 1
sequentially to end (page 6). Any help appreciated...


JMay

Printing Grouped Sheets
 
Thanks Guys,,
I got it going...
JMay

"JE McGimpsey" wrote in message
...
One way:


Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSheet As Worksheet
For Each wsSheet In ActiveWindow.SelectedSheets
wsSheet.PageSetup.LeftFooter = _
wsSheet.Range("A1") & " &P"
Next wsSheet
End Sub

See "Formatting Codes for Headers and Footers" in XL/VBA Help for more
codes.

In article <6uKnc.16193$nN6.7365@lakeread06, "JMay"
wrote:

I have 3 Worksheets which I have "Grouped"
WS01 - has 3 pages of printable stuff
WS02 - has 2 pages of ... stuff
Ws03 - has 1 page

Private Sub Workbook_BeforePrint(Cancel As Boolean)
CellInFooter
End Sub

Public Sub CellInFooter()
ActiveSheet.PageSetup.LeftFooter = Range("A1").Value & Page#
End Sub

Problem? Page# << Not working; Wish for it to print from 1
sequentially to end (page 6). Any help appreciated...





All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com