Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2002
    Location
    South Australia, Australia
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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
    Attached Files Attached Files

  2. #2
    3 Star Lounger Jim Cone's Avatar
    Join Date
    Feb 2002
    Location
    Portland, Oregon, USA
    Posts
    238
    Thanks
    0
    Thanked 3 Times in 3 Posts

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

    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

  3. #3
    New Lounger
    Join Date
    Dec 2002
    Location
    South Australia, Australia
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Jim

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

    Merry Christmas to you!!

    Kerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •