Page Numbering Function?

  • Thread starter Thread starter Stan Banner
  • Start date Start date
S

Stan Banner

Hi:
Can any one show me a UDF that can be entered into a cell of each sheet of a
workbook that will show the page number of that sheet( sheet index number).
If pages are deleted or added in between other sheets, it should
recalculate.
Thanks

Stan
 
Can any one show me a UDF that can be entered into a cell of each sheet of a
workbook that will show the page number of that sheet( sheet index number).
If pages are deleted or added in between other sheets, it should
recalculate.

This returns the name of the worksheet:

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))

That will work just fine if the names of your worksheets are simply
consecutive numbers starting with "1"

::chuckle::

I don't know of a way to return the index number without using a VBA
module.

MP-
 
Stan try:

Function SheetNo()
Application.Volatile
For x = 1 To Sheets.Count
If Sheets(x).Name = ActiveSheet.Name Then SheetNo = x
Next x
End Function

--
HTH

Sandy
(e-mail address removed)
Replace@mailinator with @tiscali.co.uk
 

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

Back
Top