Insert total of page in a worksheet in a cell

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
 
G

Gord Dibben

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


Gord Dibben MS Excel MVP
 
C

catherine

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top