Insert total of page in a worksheet in a cell

  • Thread starter Thread starter catherine
  • Start date Start date
C

catherine

Hi,

In Excel 2003, do you know how I can insert in a cell the totals pages (only
print page) that I have in the worksheet.

I don't want to use the header and footer function.

Thanks
 
Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
ActiveSheet.Range("A1").Value = TotPages
End Sub


Gord Dibben MS Excel MVP
 
Thanks, it's working

Gord Dibben said:
Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
ActiveSheet.Range("A1").Value = TotPages
End Sub


Gord Dibben MS Excel MVP
 
Back
Top