Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default inserting page breaks for specific data groups

I have a list of data with three columns--I want to automatically insert page
breaks at the end of each group in a cloumn (for example: at change in
curriculum code insert page break). Is this possible? If so , how?

Ursula
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default inserting page breaks for specific data groups

Ursula

Insert a pagebreak at each change in 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 Fri, 29 Sep 2006 12:44:03 -0700, Ursula Forte <Ursula
wrote:

I have a list of data with three columns--I want to automatically insert page
breaks at the end of each group in a cloumn (for example: at change in
curriculum code insert page break). Is this possible? If so , how?

Ursula


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default inserting page breaks for specific data groups

Let me preface with "I'm new at using Macros". What if I want to insert a
pagebreak at each change in column B?

"Gord Dibben" wrote:

Ursula

Insert a pagebreak at each change in 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 Fri, 29 Sep 2006 12:44:03 -0700, Ursula Forte <Ursula
wrote:

I have a list of data with three columns--I want to automatically insert page
breaks at the end of each group in a cloumn (for example: at change in
curriculum code insert page break). Is this possible? If so , how?

Ursula



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default inserting page breaks for specific data groups

Gord's routine works off what you have selected.

But it also inserts a page break in column B.

I'm guessing that you want the page break for the whole row:

Option Explicit

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).EntireRow.Cells(1)
.PageBreak = xlPageBreakManual
End With
End If
Next
End Sub

cbuck wrote:

Let me preface with "I'm new at using Macros". What if I want to insert a
pagebreak at each change in column B?

"Gord Dibben" wrote:

Ursula

Insert a pagebreak at each change in 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 Fri, 29 Sep 2006 12:44:03 -0700, Ursula Forte <Ursula
wrote:

I have a list of data with three columns--I want to automatically insert page
breaks at the end of each group in a cloumn (for example: at change in
curriculum code insert page break). Is this possible? If so , how?

Ursula




--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default inserting page breaks for specific data groups

Sub Insert_Pbreak()
Dim OldVal As String
Dim rng As Range
OldVal = Range("B1")
Range("B1").Select
Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select
For Each rng In Selection
If rng.Text < OldVal Then
rng.PageBreak = xlPageBreakManual
OldVal = rng.Text
End If
Next rng
End Sub


Gord

On Thu, 26 Oct 2006 13:54:02 -0700, cbuck
wrote:

Let me preface with "I'm new at using Macros". What if I want to insert a
pagebreak at each change in column B?

"Gord Dibben" wrote:

Ursula

Insert a pagebreak at each change in 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 Fri, 29 Sep 2006 12:44:03 -0700, Ursula Forte <Ursula
wrote:

I have a list of data with three columns--I want to automatically insert page
breaks at the end of each group in a cloumn (for example: at change in
curriculum code insert page break). Is this possible? If so , how?

Ursula




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
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
Problem organizing text data into new excel page Tony Excel Worksheet Functions 3 October 21st 05 08:19 PM
Page Breaks--Controlling so no division of certain data hmeyers Setting up and Configuration of Excel 0 June 14th 05 12:08 AM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM
How do I keep page breaks for each page in a sheet without the co. notexcellent Excel Discussion (Misc queries) 0 February 9th 05 07:53 PM


All times are GMT +1. The time now is 02:33 AM.

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"