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 |
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 |
All times are GMT +1. The time now is 11:56 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com