Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Delete Hpagebreak Macro
Ash:
Try this one. Sub AddDeleteHpgBks() With ActiveCell.EntireRow If .PageBreak = xlPageBreakManual Then .PageBreak = xlPageBreakNone Else .PageBreak = xlPageBreakManual End If End With End Sub -- Hope this helps Martin Fishlock Please do not forget to rate this reply. "AshMorK" wrote: Hello, How can i get a conditional macro that add/delete a Hpagebreak before the active cell if it not contains/contains a Hpagebreak? I need something like this: Sub AddDeleteHpgBks() If ActiveWindow.SelectedSheets.Activecell???HPageBrea k=true Then ActiveWindow.SelectedSheets.HPageBreaks.Add befo=ActiveCell Else ActiveWindow.SelectedSheets.HPageBreaks.Add befo=ActiveCell End If End Sub Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Delete Hpagebreak Macro
hi,
im able to make the page break mannual. I want to delete that page break and add a new one after 10 cells. im able to add a new one but the old one is not deleted. i tried to change teh location of the page break but results in an com exception. If .PageBreak = XlPageBreak.xlPageBreakManual Then .PageBreak = XlPageBreak.xlPageBreakNone Else .PageBreak = XlPageBreak.xlPageBreakManual excelDRApp.ActiveWindow.SelectedSheets.HPageBreaks .Item(break).Delete() EndIf this statement does not have any affect. Please help "Martin Fishlock" wrote: Ash: Try this one. Sub AddDeleteHpgBks() With ActiveCell.EntireRow If .PageBreak = xlPageBreakManual Then .PageBreak = xlPageBreakNone Else .PageBreak = xlPageBreakManual End If End With End Sub -- Hope this helps Martin Fishlock Please do not forget to rate this reply. "AshMorK" wrote: Hello, How can i get a conditional macro that add/delete a Hpagebreak before the active cell if it not contains/contains a Hpagebreak? I need something like this: Sub AddDeleteHpgBks() If ActiveWindow.SelectedSheets.Activecell???HPageBrea k=true Then ActiveWindow.SelectedSheets.HPageBreaks.Add befo=ActiveCell Else ActiveWindow.SelectedSheets.HPageBreaks.Add befo=ActiveCell End If End Sub Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HPageBreak Row | Excel Programming | |||
need help with hpagebreak | Excel Programming | |||
hpagebreak and vpagebreak | Excel Programming | |||
Hpagebreak help needed please | Excel Programming | |||
HPageBreak | Excel Programming |