View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Marie J-son[_6_] Marie J-son[_6_] is offline
external usenet poster
 
Posts: 1
Default 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