View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
NateBuckley NateBuckley is offline
external usenet poster
 
Posts: 146
Default how to count number of pages in worksheet

Hello I hope this helps, go to the code in ThisWorkBook.

You can do this by pushing ALT+F11 then right clicking on "ThisWorkBook" on
the left, and left clicking on view code.

Then paste in the following

Private Sub Workbook_Open()
Sheets("NameOfSheet").Cells(1, 1).Value = Worksheets.Count
End Sub

When the worksheet opens it'll count the number of worksheets and put this
value in a specified cell. So in this case if you had a sheet named
NameOfSheet it would put a number in Row 1, Column A.

Hope this helped.

"msnews" wrote:

i want to insert the count of total number of pages of a worksheet in a cell
of the same worksheet.
this should be done automatically using worksheet formula or visual basic
code or macro.
please help