• Add consecutive number in cell on each sheet (Excel 97)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Add consecutive number in cell on each sheet (Excel 97)

    Author
    Topic
    #381060

    Hi there

    In the attached spreadsheet which records attendances of employees, I would like to include something in the macro which numbers each sheet starting from 1. I would like to put this in Cell P43.

    On looking at the macro included you might be thinking “this looks quite sophisticated, why cant this person do it herself?. Well the truth is, I had a lot of help from this group putting this together and it was a few months ago. So I am not that clever.

    Any help would be greatly appreciated.

    Kerry

    Viewing 0 reply threads
    Author
    Replies
    • #640604

      Kerry,

      Do you want to add a number to each added sheet – so that the number added to sheet 4 would be 1 and the number added to sheet 5 would be 2, etc?
      If so, add the following after the line that reads: oNewSheet.Range(“P26”).Formula = “='” & strPrevSheet & “‘!P28”.
      Note: The last character is a capital i

      ‘—————————————————
      oNewSheet.Range(“P43″).Value = I
      ‘————————————————–

      Also, if you really want the instruction sheet to show when the code completes…
      Move the line: ” Worksheets(1).Activate” to the end of the Sub.

      Regards,

      Jim Cone
      San Francisco, Ca USA

      • #640605

        Jim

        Thank you – That is exactly what I wanted to do. And thanks for the other extra tip.

        Merry Christmas to you!!

        Kerry

    Viewing 0 reply threads
    Reply To: Add consecutive number in cell on each sheet (Excel 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: