Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2005, 09:49 AM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page count

Is there a way to count the number of page that's going to be print in a certain workbook?
I'm looking for a simple one, I know that I can do it with hbreak and vbreak.
 
Old January 24th, 2005, 10:49 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi goLynxgo

Sub countpagebreaks()
    Dim myVPages As Integer
    Dim myHPages As Integer

        myVPages = ActiveWindow.SelectedSheets.VPageBreaks.Count + 1
        myHPages = ActiveWindow.SelectedSheets.HPageBreaks.Count + 1

        MsgBox (myVPages * myHPages)
End Sub

cheers

Matthew

 
Old January 24th, 2005, 11:08 AM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's the way I knew, the problem is that my macro prints hundreds of page and doing this thing makes the macro take 3 times more time to run

I only wanted to know if there were alternative ways to do it.
Thanks :)
 
Old January 24th, 2005, 01:52 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How have you got the macro to select and print each page, are you using loops that select each page independently?

Cheers

Matthew






Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Count problem myself Classic ASP Professional 1 July 20th, 2006 02:32 AM
Page Count kondapally Crystal Reports 0 April 13th, 2006 02:29 PM
is there any in built function to count page count g.tamilselvan MySQL 1 February 15th, 2006 07:43 AM
Getting Total Page Count eman2a Crystal Reports 0 August 11th, 2004 10:53 AM
Total Page Count denis74hd Crystal Reports 4 May 27th, 2004 02:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.