ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Print auto page breaks (https://www.excelbanter.com/excel-discussion-misc-queries/215546-print-auto-page-breaks.html)

Cameron

Print auto page breaks
 
Can I have a worksheet print with auto page breaks? EX: I have a column with
repeating information sorted in alphabetical order - Names. I want to print
separate pages for each person. Can I have Excel automatically put page
breaks after each grouped set of names? I could do it manually but there are
a lot of names and it would be too time consuming.

Cameron


Gord Dibben

Print auto page breaks
 
Sub Insert_PBreak()
Dim OldVal As String
Dim rng As Range
OldVal = Range("A1")
For Each rng In Range("A1:A300") '<< change range
If rng.text < OldVal Then
rng.PageBreak = xlPageBreakManual
OldVal = rng.text
End If
Next rng
End Sub


Gord Dibben MS Excel MVP

On Tue, 6 Jan 2009 12:56:02 -0800, Cameron
wrote:

Can I have a worksheet print with auto page breaks? EX: I have a column with
repeating information sorted in alphabetical order - Names. I want to print
separate pages for each person. Can I have Excel automatically put page
breaks after each grouped set of names? I could do it manually but there are
a lot of names and it would be too time consuming.

Cameron




All times are GMT +1. The time now is 06:01 AM.

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