• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Find number of Page Breaks in active sheet [SOLVED]

nagovind

Member
Dear All

Please share the VBA code to count the total no. of Page breaks in a page including manual + auto page breaks

So that the total no. of pages in active sheet = Total Page breaks -1

To automate the total pages this is required

Please advise
 
Hi Govind ,


Does this link , and the link posted within it , help ?


http://www.ozgrid.com/forum/showthread.php?t=77407


Narayan
 
I am sure you will find something in this link that would be useful for you:

http://chandoo.org/forums/topic/macro-to-return-page-number-of-a-named-cell
 
Dear All,


Below code is working for me

[pre]
Code:
Sub Macro1()

Dim iHpBreaks As Integer, iVBreaks As Integer
Dim iTotPages As Integer

iHpBreaks = ActiveSheet.HPageBreaks.Count + 1
iVBreaks = ActiveSheet.VPageBreaks.Count + 1

iTotPages = iHpBreaks * iVBreaks
MsgBox "This sheet will require " & iTotPages & _
" page(s) to print", vbInformation, "Info"
End Sub
[/pre]
Thank you
 
Back
Top