Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting Page Breaks | Excel Discussion (Misc queries) | |||
setting page breaks. | Excel Programming | |||
MS Office Excel97: Removing Page Breaks | Excel Discussion (Misc queries) | |||
Setting page breaks (another) | Excel Programming | |||
Removing Page Breaks. | Excel Programming |