+ Reply to Thread
Results 1 to 4 of 4

increment/populate numbers by worksheet

  1. #1
    br549
    Guest

    increment/populate numbers by worksheet

    I want to populate cell A1 in each worksheet in my workbook with a number
    that increments by one every sheet. So A1 value in first worksheet would be
    1; in second worksheet, 2 etc.

    How?

  2. #2
    Frank Kabel
    Guest

    Re: increment/populate numbers by worksheet

    Hi
    maybe the following helps you:
    http://www.*****-blog.com/archives/2...eet/trackback/



    --
    Regards
    Frank Kabel
    Frankfurt, Germany
    "br549" <[email protected]> schrieb im Newsbeitrag
    news:[email protected]...
    >I want to populate cell A1 in each worksheet in my workbook with a number
    > that increments by one every sheet. So A1 value in first worksheet would
    > be
    > 1; in second worksheet, 2 etc.
    >
    > How?




  3. #3
    Gord Dibben
    Guest

    Re: increment/populate numbers by worksheet

    br

    This code was originally written to increase a date in A1 across sheets.

    Have re-written to increase a number across sheets. Left in the date
    parts(commented) in case you ever wanted to use that.

    Sub Date_Increment()
    ''increment a date in A1 across sheets
    Dim myDate As Long 'Date
    Dim iCtr As Long
    myDate = 1 'DateSerial(2004, 4, 19)
    For iCtr = 1 To Worksheets.Count
    With Worksheets(iCtr).Range("A1")
    .Value = myDate - 1 + iCtr
    .NumberFormat = 0 ' "mm/dd/yyyy"
    End With
    Next iCtr
    End Sub


    Gord Dibben Excel MVP

    On Tue, 4 Jan 2005 12:05:04 -0800, "br549" <[email protected]>
    wrote:

    >I want to populate cell A1 in each worksheet in my workbook with a number
    >that increments by one every sheet. So A1 value in first worksheet would be
    >1; in second worksheet, 2 etc.
    >
    >How?



  4. #4
    RagDyer
    Guest

    Re: increment/populate numbers by worksheet

    If your sheets are the default XL names (Sheet1, Sheet2, ... etc.)
    OR
    You care to name them in such a way that the last character in the sheet
    name is the "page" number, you could simply use this formula in A1 of each
    sheet:

    =RIGHT(CELL("filename",A1))
    --

    HTH,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "br549" <[email protected]> wrote in message
    news:[email protected]...
    I want to populate cell A1 in each worksheet in my workbook with a number
    that increments by one every sheet. So A1 value in first worksheet would be
    1; in second worksheet, 2 etc.

    How?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1