View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Wild Bill[_2_] Wild Bill[_2_] is offline
external usenet poster
 
Posts: 90
Default Page Break Preview Page Number


**** WARNING - .hpagebreaks.count ****

The theatrics are because I am amending what I patly asserted earlier.

(VPageBreaks.count+1)*(HPageBreaks.count+1) is your print page total

..hpagebreaks.count+1 is NOT the total vertical page count if there is a
HARD page break at bottom of the print range. In THAT case,
..hpagebreaks.count is the total vertical page count.
..vpagebreaks.count behaves analogously with a hard columnar page break.

Verified on XL97, XL03. Other than self-policing that there are no hard
page breaks at the edge of the print range (which might be just cool for
you, Neal), the only prohibitive solution that I could see would be to
test .HPageBreaks.Item(.hpagebreaks.count).Location against the bottom
row of the print area. And the same would apply for testing vpagebreaks.

Sorry - I just discovered this, and I feel like a pinhead for neglecting
this if anyone reading the thread uses .Count without reading this far.

A hard page break results from menu Insert/Break/Page Break. To my
knowledge, hard breaks are neither created nor destroyed by manipulating
the Page Break Preview interface, where you can drag break locations.

There are 20 or more REAL gurus here that are intimately familiar with
Excel internals, in case any of them care to weigh in.