View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme Bernard Liengme is offline
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?