Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Returning page-count to a cell

Is it possible to return the total pages in a workbook? I know the formula
for sheets (or tabs), but at least one sheet, when printed has 2 or more
pages.

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 269
Default Returning page-count to a cell

As far as I know there is not a built in function for this.

There are some methods available using VBA.

This displays the count.

Sub printcounter()

wscount = ActiveWorkbook.Worksheets.Count
For a = 1 To wscount
Sheets(a).Activate
PAGECOUNT = Application.ExecuteExcel4Macro("Get.Document(50)") + PAGECOUNT

Next a
MsgBox (PAGECOUNT & " Pages to Print")

End Sub


--
If this helps, please remember to click yes.


"NAHolmes" wrote:

Is it possible to return the total pages in a workbook? I know the formula
for sheets (or tabs), but at least one sheet, when printed has 2 or more
pages.

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Returning page-count to a cell

Thanks Paul.

The sub did display the total pages, but it also moved all the text boxes in
the workbook.

Also, is it possible to return the number to a cell?

Thanks again for your help.

"Paul C" wrote:

As far as I know there is not a built in function for this.

There are some methods available using VBA.

This displays the count.

Sub printcounter()

wscount = ActiveWorkbook.Worksheets.Count
For a = 1 To wscount
Sheets(a).Activate
PAGECOUNT = Application.ExecuteExcel4Macro("Get.Document(50)") + PAGECOUNT

Next a
MsgBox (PAGECOUNT & " Pages to Print")

End Sub


--
If this helps, please remember to click yes.


"NAHolmes" wrote:

Is it possible to return the total pages in a workbook? I know the formula
for sheets (or tabs), but at least one sheet, when printed has 2 or more
pages.

Thanks in advance.

Reply
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
Filter results returning a count __ of __ caryn Excel Discussion (Misc queries) 1 October 8th 08 08:01 PM
Formula Question involving two columns and returning a count bswood7 Excel Discussion (Misc queries) 4 March 25th 08 01:14 PM
COUNT returning 0? Jen Excel Worksheet Functions 4 October 26th 07 05:33 PM
Page Count pkferret Excel Discussion (Misc queries) 3 April 12th 06 03:19 PM
returning a count if two conditions are met davmason Excel Worksheet Functions 5 July 17th 05 04:25 AM


All times are GMT +1. The time now is 06:40 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"