Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Inserting Page Breaks

I'd like to know if there's an easy way to insert page breaks into my
spreadsheet. I have a list in column B. Some of the items in the colums a
listed more than once. I've sorted the list in ascending order and now I'd
like to insert a page break between each individual item.

Is there a way to accomplish this with some formula (or other method), or do
I have to manually insert a page break after each item?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Inserting Page Breaks

This VBA subroutine seems to work

Sub breakup()
ActiveWindow.View = xlPageBreakPreview
Range("B1").Select
Range(Selection, Selection.End(xlDown)).Select
mytest = Range("B1").Value
For Each mycell In Selection
If mycell.Value < mytest Then
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=mycell
mytest = mycell.Value
End If
ActiveWindow.View = xlNormalView
Next
End Sub

Need help with VBA? See David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"blasds78" wrote in message
...
I'd like to know if there's an easy way to insert page breaks into my
spreadsheet. I have a list in column B. Some of the items in the colums
a
listed more than once. I've sorted the list in ascending order and now
I'd
like to insert a page break between each individual item.

Is there a way to accomplish this with some formula (or other method), or
do
I have to manually insert a page break after each item?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Inserting Page Breaks

Bernard,

Thanks for your help. I'm sure that works, but I'm too much of a novice to
understand those commands.

Thanks,
Doug

"Bernard Liengme" wrote:

This VBA subroutine seems to work

Sub breakup()
ActiveWindow.View = xlPageBreakPreview
Range("B1").Select
Range(Selection, Selection.End(xlDown)).Select
mytest = Range("B1").Value
For Each mycell In Selection
If mycell.Value < mytest Then
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=mycell
mytest = mycell.Value
End If
ActiveWindow.View = xlNormalView
Next
End Sub

Need help with VBA? See David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"blasds78" wrote in message
...
I'd like to know if there's an easy way to insert page breaks into my
spreadsheet. I have a list in column B. Some of the items in the colums
a
listed more than once. I've sorted the list in ascending order and now
I'd
like to insert a page break between each individual item.

Is there a way to accomplish this with some formula (or other method), or
do
I have to manually insert a page break after each item?




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Inserting Page Breaks

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord

On Tue, 22 May 2007 06:42:02 -0700, blasds78
wrote:

Bernard,

Thanks for your help. I'm sure that works, but I'm too much of a novice to
understand those commands.

Thanks,
Doug

"Bernard Liengme" wrote:

This VBA subroutine seems to work

Sub breakup()
ActiveWindow.View = xlPageBreakPreview
Range("B1").Select
Range(Selection, Selection.End(xlDown)).Select
mytest = Range("B1").Value
For Each mycell In Selection
If mycell.Value < mytest Then
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=mycell
mytest = mycell.Value
End If
ActiveWindow.View = xlNormalView
Next
End Sub

Need help with VBA? See David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"blasds78" wrote in message
...
I'd like to know if there's an easy way to insert page breaks into my
spreadsheet. I have a list in column B. Some of the items in the colums
a
listed more than once. I've sorted the list in ascending order and now
I'd
like to insert a page break between each individual item.

Is there a way to accomplish this with some formula (or other method), or
do
I have to manually insert a page break after each item?





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
I can't move my page breaks in Page Break Preview btaft Excel Discussion (Misc queries) 6 April 27th 23 11:49 AM
inserting page breaks for specific data groups Ursula Forte Excel Discussion (Misc queries) 4 October 27th 06 01:16 AM
inserting multiple page breaks at one time JPRENDER Excel Discussion (Misc queries) 0 March 22nd 06 05:46 PM
Inserting Page Breaks chrisnelsonusa1 Excel Discussion (Misc queries) 3 December 9th 05 10:34 PM
Inserting line breaks into merged text cells. MrSafetyNeedshelp Excel Discussion (Misc queries) 1 August 11th 05 10:12 PM


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