Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Returning page-count to a cell

1 view
Skip to first unread message

NAHolmes

unread,
Nov 23, 2009, 9:49:01 AM11/23/09
to
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.

Paul C

unread,
Nov 23, 2009, 10:35:03 AM11/23/09
to
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

unread,
Nov 25, 2009, 3:11:02 AM11/25/09
to
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.

0 new messages