Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
number of pages
I use this
Sub NumberOfPrintedPages() Worksheets(1).DisplayAutomaticPageBreaks = True HorizBreaks = Worksheets(1).HPageBreaks.Count HPages = HorizBreaks + 1 VertBreaks = Worksheets(1).VPageBreaks.Count VPages = VertBreaks + 1 NumPages = HPages * VPages Worksheets(1).DisplayAutomaticPageBreaks = False MsgBox NumPages End Sub But sometimes it gives me 1 more page then it really is. So it adds extra vertical break. How is it possible to trouble shoot this |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
number of pages
Maybe this method gives better results.
http://j-walk.com/ss/excel/tips/tip65.htm NickHK "Monte0682" groups.com... I use this Sub NumberOfPrintedPages() Worksheets(1).DisplayAutomaticPageBreaks = True HorizBreaks = Worksheets(1).HPageBreaks.Count HPages = HorizBreaks + 1 VertBreaks = Worksheets(1).VPageBreaks.Count VPages = VertBreaks + 1 NumPages = HPages * VPages Worksheets(1).DisplayAutomaticPageBreaks = False MsgBox NumPages End Sub But sometimes it gives me 1 more page then it really is. So it adds extra vertical break. How is it possible to trouble shoot this |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Number of pages in worksheet doesn't match Print Preview pages | Excel Discussion (Misc queries) | |||
How can I number pages so it changes every 3 pages? | Excel Discussion (Misc queries) | |||
Number of pages | Excel Worksheet Functions | |||
How do i number pages in a header consequently | Excel Worksheet Functions | |||
Number of pages | Excel Programming |