#1   Report Post  
Don
 
Posts: n/a
Default Insert Page Break

Is it possible to insert a page break automatically when specific text is
encountered in row A. This report is hundreds of pages long and I need an
automatic page insert macro. Can someone give me the syntax of a macro if
the specific text is "Break"? Thanks for any help.

--
Don Rountree
  #2   Report Post  
tina
 
Posts: n/a
Default

Hi Don
Try
Sub Macropagebreak()
For Each CELL In Range("A:A")
If CELL = "BREAK" Then
CELL.Rows.Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell
Else
End If
Next
End Sub

"Don" wrote:

Is it possible to insert a page break automatically when specific text is
encountered in row A. This report is hundreds of pages long and I need an
automatic page insert macro. Can someone give me the syntax of a macro if
the specific text is "Break"? Thanks for any help.

--
Don Rountree

  #3   Report Post  
Don
 
Posts: n/a
Default

Thank you for your help. I entered this macro and when I ran it I got the
error message that said - Complie error, variable not defined. The first
instance of the word CELL was highlighted. Please tell me how to define this
variable.
--
Don Rountree


"tina" wrote:

Hi Don
Try
Sub Macropagebreak()
For Each CELL In Range("A:A")
If CELL = "BREAK" Then
CELL.Rows.Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell
Else
End If
Next
End Sub

"Don" wrote:

Is it possible to insert a page break automatically when specific text is
encountered in row A. This report is hundreds of pages long and I need an
automatic page insert macro. Can someone give me the syntax of a macro if
the specific text is "Break"? Thanks for any help.

--
Don Rountree

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

Sub MacroPageBreak()
Dim Cell as Range '<-- add this line
'''rest of code here

Don wrote:

Thank you for your help. I entered this macro and when I ran it I got the
error message that said - Complie error, variable not defined. The first
instance of the word CELL was highlighted. Please tell me how to define this
variable.
--
Don Rountree

"tina" wrote:

Hi Don
Try
Sub Macropagebreak()
For Each CELL In Range("A:A")
If CELL = "BREAK" Then
CELL.Rows.Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell
Else
End If
Next
End Sub

"Don" wrote:

Is it possible to insert a page break automatically when specific text is
encountered in row A. This report is hundreds of pages long and I need an
automatic page insert macro. Can someone give me the syntax of a macro if
the specific text is "Break"? Thanks for any help.

--
Don Rountree


--

Dave Peterson
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
Page scaling & Page break preview prob Martin ©¿©¬ @REMOVETHIS.plus.com Excel Discussion (Misc queries) 1 July 17th 05 09:10 PM
How do I delete the page watermark in the page break preview? fragilemouse Excel Discussion (Misc queries) 2 May 19th 05 03:16 PM
How do I change "PAGE 1" characteristics in page break? dmtaurus Excel Discussion (Misc queries) 2 May 4th 05 03:07 PM
adding a new page break to an existing page break Edward Letendre Excel Discussion (Misc queries) 1 March 6th 05 09:29 AM
content does not stay in page break notexcellent Excel Worksheet Functions 1 February 13th 05 05:55 AM


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