ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Removing HPageBreaks frrom Ranges (https://www.excelbanter.com/excel-programming/319251-removing-hpagebreaks-frrom-ranges.html)

Subs

Removing HPageBreaks frrom Ranges
 
Hi can someone help me here

I'm setting HPageBreaks in predined places
however when I look at the PrintPreview
I can see other breaklines which are broken lines
How do I get rid of these.

Here's the code I'm using

..ResetAllPageBreaks
.PageSetup.PrintArea = ""
.PageSetup.PrintTitleRows = ""
.PageSetup.PrintTitleColumns = ""
.PageSetup.PrintArea = ActiveSheet.Range(Cells(6, startCol),
Cells(lastRow, stopCol)).Address
.PageSetup.PrintTitleRows = "$1:$6"
.PageSetup.PrintTitleColumns = colTiCh



.HPageBreaks.Add Befo=.Range("A44")
.HPageBreaks.Add Befo=.Range("A62")

VbreakCount = .VPageBreaks.Count
HbreakCount = .HPageBreaks.Count

For i = 1 To HbreakCount
For j = 1 To VbreakCount
Set numHBreaks = .HPageBreaks(i).Location
Set numVBreaks = .VPageBreaks(j).Location
Next j
Next i


thanks for any help

Subs



Tom Ogilvy

Removing HPageBreaks frrom Ranges
 
Those are probably automatic pagebreaks. Those appear when the printer
settings/page setup dictate that a pagebreak must appear at that location
(if you print, the printer will break at that location). .

Unless you change your settings, you can not get rid of them.

--
Regards,
Tom Ogilvy

"Subs" wrote in message
...
Hi can someone help me here

I'm setting HPageBreaks in predined places
however when I look at the PrintPreview
I can see other breaklines which are broken lines
How do I get rid of these.

Here's the code I'm using

.ResetAllPageBreaks
.PageSetup.PrintArea = ""
.PageSetup.PrintTitleRows = ""
.PageSetup.PrintTitleColumns = ""
.PageSetup.PrintArea = ActiveSheet.Range(Cells(6, startCol),
Cells(lastRow, stopCol)).Address
.PageSetup.PrintTitleRows = "$1:$6"
.PageSetup.PrintTitleColumns = colTiCh



.HPageBreaks.Add Befo=.Range("A44")
.HPageBreaks.Add Befo=.Range("A62")

VbreakCount = .VPageBreaks.Count
HbreakCount = .HPageBreaks.Count

For i = 1 To HbreakCount
For j = 1 To VbreakCount
Set numHBreaks = .HPageBreaks(i).Location
Set numVBreaks = .VPageBreaks(j).Location
Next j
Next i


thanks for any help

Subs






All times are GMT +1. The time now is 06:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com