Announcement

Collapse
No announcement yet.

Page Numbering Formula

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Page Numbering Formula

    Hello; I'm not at all good with Excel Macros or VBA scripts so please forgive me if this is a simple question..

    Here's what I need to do. I have a spread sheet that contains several worksheets and I need to place a page number formula in a cell on the page rather than printing it as a header or footer command. I'm sure that this is possible but I'm not sure what the Macro or VBA code would look like or even where to place it.

    Thanks in advance for your help on this....Scott

  • #2
    Re: Page Numbering Formula

    Scott,

    Welcome to Ozgrid.

    I do not think there is a simple method without resorting to VBA.

    With VBA you could add a command button and write this behind it.

    Code:
    Private Sub CommandButton1_Click()
    Dim ws As Worksheet
    For Each ws In Worksheets
        ws.Range("a1").Value = ws.Name ' Enters Sheet Name in A1
        ws.Range("a2").Value = ws.Index ' Enters Sheet index in A2
    Next ws
    End Sub
    I added the name and number you could edit out the name if you don't need it

    and attached
    HTH
    Carl
    Attached Files
    Last edited by carlmack; June 15th, 2006, 02:41.
    locii Insight
    Locii Solutions. Business IT Training. Business Consulting. Excel Training. Business Intelligence using Excel 2010. Cyprus.

    Comment

    Working...
    X