Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Setting and removing page breaks

I have an Excel worksheet where I want to insert a page break at certain
rows---providing the row has not been hidden by the user. Here is an example
of the code I am using to insert one of the page breaks:

If Range("A70").EntireRow.Hidden = False Then
Rows("70:70").Select
ActiveWindow.SelectedSheets.HPageBreaks.add Befo=ActiveCell
Else
End If

This code works great, however, I want to create a similar routine to remove
an existing page break if it exists. In other words, using the above
example, I want it to look at row 70 to see if there is a page break, and if
so, remove it. In this code, I want the page break to be removed regardless
of whether the row is hidden or not. What is the best way to accomplish this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Setting and removing page breaks

Worksheets("Sheet1").Rows(70).PageBreak = xlPageBreakNone

If this post helps click Yes
---------------
Jacob Skaria


"jday" wrote:

I have an Excel worksheet where I want to insert a page break at certain
rows---providing the row has not been hidden by the user. Here is an example
of the code I am using to insert one of the page breaks:

If Range("A70").EntireRow.Hidden = False Then
Rows("70:70").Select
ActiveWindow.SelectedSheets.HPageBreaks.add Befo=ActiveCell
Else
End If

This code works great, however, I want to create a similar routine to remove
an existing page break if it exists. In other words, using the above
example, I want it to look at row 70 to see if there is a page break, and if
so, remove it. In this code, I want the page break to be removed regardless
of whether the row is hidden or not. What is the best way to accomplish this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Setting and removing page breaks

Perfect---thanks!!

"Jacob Skaria" wrote:

Worksheets("Sheet1").Rows(70).PageBreak = xlPageBreakNone

If this post helps click Yes
---------------
Jacob Skaria


"jday" wrote:

I have an Excel worksheet where I want to insert a page break at certain
rows---providing the row has not been hidden by the user. Here is an example
of the code I am using to insert one of the page breaks:

If Range("A70").EntireRow.Hidden = False Then
Rows("70:70").Select
ActiveWindow.SelectedSheets.HPageBreaks.add Befo=ActiveCell
Else
End If

This code works great, however, I want to create a similar routine to remove
an existing page break if it exists. In other words, using the above
example, I want it to look at row 70 to see if there is a page break, and if
so, remove it. In this code, I want the page break to be removed regardless
of whether the row is hidden or not. What is the best way to accomplish this?

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
Setting Page Breaks Ken Hudson Excel Discussion (Misc queries) 1 January 5th 10 08:47 PM
setting page breaks. Rod[_2_] Excel Programming 3 May 23rd 06 12:28 AM
MS Office Excel97: Removing Page Breaks W. Watson Excel Discussion (Misc queries) 2 April 15th 05 11:38 PM
Setting page breaks (another) Ian W[_2_] Excel Programming 1 March 15th 05 12:23 PM
Removing Page Breaks. Michael Beckinsale Excel Programming 0 September 7th 03 09:24 AM


All times are GMT +1. The time now is 04:43 PM.

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"