Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is there a way to either write a macro or something else so that each time a
certain word appears (total) a page break inserts? It's a long report that I need to print each totaled group on a separate page. It would be great if I could somehow get the page breaks in without having to add each one manually. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this code. It searches column A for the word Add and puts a page break
after the row with the word ADD ActiveSheet.ResetAllPageBreaks LastRow = ActiveSheet.Cells. _ SpecialCells(Type:=xlCellTypeLastCell).Row For RowCount = 1 To LastRow If Range("A" & RowCount) = "Add" Then ActiveSheet.HPageBreaks.Add _ befo=Rows(RowCount + 1) End If Next RowCount "mcie2" wrote: Is there a way to either write a macro or something else so that each time a certain word appears (total) a page break inserts? It's a long report that I need to print each totaled group on a separate page. It would be great if I could somehow get the page breaks in without having to add each one manually. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I can't move my page breaks in Page Break Preview | Excel Discussion (Misc queries) | |||
How do I do page breaks when view menu doesnt page break preview | Excel Discussion (Misc queries) | |||
Page Breaks- Printing selected rows on same page | Excel Discussion (Misc queries) | |||
Display page breaks automatically | Setting up and Configuration of Excel | |||
Automatically enter page breaks? | Excel Worksheet Functions |