Page Numbering Function?

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
 
M

Mangus Pyke

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-
 
S

Sandy Mann

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
[email protected]
Replace@mailinator with @tiscali.co.uk
 
Top