Closed Thread
Results 1 to 3 of 3

Can Excel AutoNumber

  1. #1
    Globe Director
    Guest

    Can Excel AutoNumber

    Can a cell be set up to function as AutoNumber does in MS Access? Each time
    a worksheet is opened the cell increments one number, or can a macro be
    generated to do this function after the workbook is opened?

  2. #2
    Gary L Brown
    Guest

    RE: Can Excel AutoNumber

    To increment a number by 1 everytime a worksheet is activated, put the
    following code in that worksheet's module.

    To do that, get into the VBE (Alt-F11). In the Project window,
    double-left-click on the worksheet you want to use. In the Code window (to
    the right of the Project window), put the following code.

    '/===============================/
    Private Sub Worksheet_Activate()
    Range("A1").Value = Range("A1").Value + 1
    End Sub
    '/===============================/

    "A1" can actually be any cell you want the number to appear in.

    HTH
    --
    Gary Brown
    gary_brown@ge_NOSPAM.com
    If this post was helpful, please click the ''Yes'' button next to ''Was this
    Post Helpfull to you?''.


    "Globe Director" wrote:

    > Can a cell be set up to function as AutoNumber does in MS Access? Each time
    > a worksheet is opened the cell increments one number, or can a macro be
    > generated to do this function after the workbook is opened?


  3. #3
    Globe Director
    Guest

    RE: Can Excel AutoNumber

    Gary,
    Thanks!!! I put your code into the WorkBook's module, and each time the
    file is opened the cell increments. FYI this is for a Return Material
    Authorization form.

    Globe Director

    "Gary L Brown" wrote:

    > To increment a number by 1 everytime a worksheet is activated, put the
    > following code in that worksheet's module.
    >
    > To do that, get into the VBE (Alt-F11). In the Project window,
    > double-left-click on the worksheet you want to use. In the Code window (to
    > the right of the Project window), put the following code.
    >
    > '/===============================/
    > Private Sub Worksheet_Activate()
    > Range("A1").Value = Range("A1").Value + 1
    > End Sub
    > '/===============================/
    >
    > "A1" can actually be any cell you want the number to appear in.
    >
    > HTH
    > --
    > Gary Brown
    > gary_brown@ge_NOSPAM.com
    > If this post was helpful, please click the ''Yes'' button next to ''Was this
    > Post Helpfull to you?''.
    >
    >
    > "Globe Director" wrote:
    >
    > > Can a cell be set up to function as AutoNumber does in MS Access? Each time
    > > a worksheet is opened the cell increments one number, or can a macro be
    > > generated to do this function after the workbook is opened?


Closed 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