LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Excel Page count

One way:

Public Function NumPagesInWorkbook( _
Optional ByRef wkBook As Workbook) As Integer
Dim wkSht As Worksheet
If wkBook Is Nothing Then Set wkBook = ActiveWorkbook
For Each wkSht In wkBook.Worksheets
With wkSht
If Application.CountA(.Cells) Then
NumPages = NumPages + _
(.HPageBreaks.Count + 1) * _
(.VPageBreaks.Count + 1)
End If
End With
Next wkSht
End Function

In article ,
"Joe" wrote:

Would anybody have some example code that shows count the
number of pages that are shown in the page break preview
in Excel? I am trying to get page counts from different
office files by looping thru a column in Excel that
contains file names. When I find an Excel file, I want to
count the number of pages that will be displayed in the
page break preview view.


Thanks

Joe.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning page-count to a cell NAHolmes Excel Worksheet Functions 2 November 25th 09 08:11 AM
Page Count with Tabs tom Excel Discussion (Misc queries) 3 October 27th 06 04:09 AM
How do I remove the page count on work Freddyp1 Setting up and Configuration of Excel 1 September 8th 06 11:39 PM
Page Count pkferret Excel Discussion (Misc queries) 3 April 12th 06 03:19 PM
Excel Page count Tom Ogilvy Excel Programming 0 July 17th 03 03:06 PM


All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"