Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello I created a purchase order template. I need to show the number of
pages of the purchase order, but not in a header or footer. Example Cell F10 is " No. Pages" (means the no of pages for the purchase order) cell G11 should automatically populate number of pages ( 2, 3 or how many papges there are for the order.) How can I do this? thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub Pages_In_Cell()
Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") ActiveSheet.Range("G11") = TotPages ActiveSheet.PrintOut End Sub Or event code in Thisworkbook module. Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") ActiveSheet.Range("G11") = TotPages ActiveSheet.PrintOut End Sub Gord Dibben MS Excel MVP On Sun, 7 Oct 2007 13:16:04 -0700, Marilyn wrote: Hello I created a purchase order template. I need to show the number of pages of the purchase order, but not in a header or footer. Example Cell F10 is " No. Pages" (means the no of pages for the purchase order) cell G11 should automatically populate number of pages ( 2, 3 or how many papges there are for the order.) How can I do this? thanks |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is there a way to do this, but instead of referencing total pages, to
reference the page number of a specific page/sheet from the work book (so say I switch the position of the sheet from the last page to the third page, how to I make sure that the cell will track that change). Ben "Gord Dibben" wrote: Sub Pages_In_Cell() Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") ActiveSheet.Range("G11") = TotPages ActiveSheet.PrintOut End Sub Or event code in Thisworkbook module. Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") ActiveSheet.Range("G11") = TotPages ActiveSheet.PrintOut End Sub Gord Dibben MS Excel MVP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to display current page number in any cell of that page. | Excel Discussion (Misc queries) | |||
To show page number in a cell | Excel Worksheet Functions | |||
how to insert a page number in a cell | Excel Worksheet Functions | |||
sheet tabs as page number and in a cell page of pages? | Excel Discussion (Misc queries) | |||
Page Number of a cell | Excel Worksheet Functions |