Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Returning page-count to a cell | Excel Worksheet Functions | |||
Page Count with Tabs | Excel Discussion (Misc queries) | |||
How do I remove the page count on work | Setting up and Configuration of Excel | |||
Page Count | Excel Discussion (Misc queries) | |||
Excel Page count | Excel Programming |