ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How store PageBrakes locations - Coded pagebrakes are deleted in Workbook_BeforePrint (https://www.excelbanter.com/excel-programming/328963-how-store-pagebrakes-locations-coded-pagebrakes-deleted-workbook_beforeprint.html)

Marie J-son[_6_]

How store PageBrakes locations - Coded pagebrakes are deleted in Workbook_BeforePrint
 
Hi,

I have several rows hidden at different areas and many defined pagebrakes -
about 25 of them.
When I run this line in Workbook_BeforePrint the printout areas will be ok,
but the line sweep away all my pagebrakes! How can I keep the pagebrakes as
they should???

....
Sheet1.PageSetup.PrintArea = Sheet1.Range(Cells(1, 1),
Cells(Sheet1.Range("bpAfSeTab").Row - 1,
15)).SpecialCells(xlVisible).Address
....

(bpAfFiTab = cell reference in the A:A column that tell where the end is,
dynamic because of tables of dynamic sizes)


Regards



Tom Ogilvy

How store PageBrakes locations - Coded pagebrakes are deleted in Workbook_BeforePrint
 
That line won't affect your pagebreaks. Perhaps you are using fit to print
which ignores pagebreaks.

--
Regards,
Tom Ogilvy

"Marie J-son" wrote in message
...
Hi,

I have several rows hidden at different areas and many defined

pagebrakes -
about 25 of them.
When I run this line in Workbook_BeforePrint the printout areas will be

ok,
but the line sweep away all my pagebrakes! How can I keep the pagebrakes

as
they should???

...
Sheet1.PageSetup.PrintArea = Sheet1.Range(Cells(1, 1),
Cells(Sheet1.Range("bpAfSeTab").Row - 1,
15)).SpecialCells(xlVisible).Address
...

(bpAfFiTab = cell reference in the A:A column that tell where the end is,
dynamic because of tables of dynamic sizes)


Regards






All times are GMT +1. The time now is 01:16 PM.

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