LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default how to automatically add page breaks?

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.

 
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
How do I do page breaks when view menu doesnt page break preview HeatherF55 Excel Discussion (Misc queries) 0 September 21st 07 04:24 AM
Page Breaks- Printing selected rows on same page ToddEZ Excel Discussion (Misc queries) 1 July 18th 07 04:38 PM
Display page breaks automatically Ice Man Setting up and Configuration of Excel 5 February 22nd 07 08:24 PM
Automatically enter page breaks? Dan B Excel Worksheet Functions 2 May 9th 06 10:32 PM


All times are GMT +1. The time now is 03:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"