jim may
Well-known Member
- Joined
- Jul 4, 2004
- Messages
- 7,486
Allen Wyatt (on his site) has created the below Code and it works GREAT.
Is there anyway it can be MODIFIED (the above) to On Each Previewd Page (Grouped BY Dept) that I can Create a Page Header and in it
Reference the "Department Field Name" being Currently Printed (below on that page)?
Thanks in Advance...
Jim
Code:
Sub PageBreak()
Dim CellRange As Range
Dim TestCell As Range
Set CellRange = Selection
For Each TestCell In CellRange
ActiveSheet.Rows(TestCell.Row).PageBreak = xlPageBreakNone
If TestCell.Value <> TestCell.Offset(-1, 0).Value Then
ActiveSheet.Rows(TestCell.Row).PageBreak = xlPageBreakManual
End If
Next TestCell
With ActiveSheet
.PrintPreview
End With
End Sub
Is there anyway it can be MODIFIED (the above) to On Each Previewd Page (Grouped BY Dept) that I can Create a Page Header and in it
Reference the "Department Field Name" being Currently Printed (below on that page)?
Thanks in Advance...
Jim