#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default auto add page breaks

I import a report from Access into Excel that has grouped together East
Precinct, West Precinct, North Precinct and Central Precinct. Is there a way
I could have excel automatically insert a page break at the end of each
group? I want it all on the same spreadsheet, I just want East on page 1,
west on page 2 and so on. Can this be done?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default auto add page breaks

If your data looks like this

east
east
east
west
west
west
etc
etc
etc

This macro will insert a pagebreak at each change of data column A

Sub InsertBreak_At_Change()
Dim i As Long
For i = Selection.Rows.Count To 1 Step -1
If Selection(i).Row = 1 Then Exit Sub
If Selection(i) < Selection(i - 1) And Not IsEmpty _
(Selection(i - 1)) Then
With Selection(i)
.PageBreak = xlPageBreakManual
End With
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Tue, 26 Sep 2006 09:05:01 -0700, Pam Coleman
wrote:

I import a report from Access into Excel that has grouped together East
Precinct, West Precinct, North Precinct and Central Precinct. Is there a way
I could have excel automatically insert a page break at the end of each
group? I want it all on the same spreadsheet, I just want East on page 1,
west on page 2 and so on. Can this be done?


Reply
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
Page breaks heart1 Excel Worksheet Functions 4 November 12th 05 01:28 AM
Auto insert page breaks in Excel, based on a sort of numbers peterc89 Excel Discussion (Misc queries) 0 November 9th 05 03:41 PM
page breaks ZWILLINGE Excel Discussion (Misc queries) 1 August 31st 05 08:55 PM
find automatic page breaks Reason Excel Worksheet Functions 1 April 15th 05 06:03 AM
Auto page numbering for several worksheets Andy Excel Worksheet Functions 1 March 13th 05 04:41 AM


All times are GMT +1. The time now is 08:56 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"