+ Reply to Thread
Results 1 to 5 of 5

consecutive numbers

  1. #1
    Registered User
    Join Date
    05-13-2005
    Posts
    12

    Question consecutive numbers

    I'm creating a purchase order form in Excel. I would like the purchase order number (in, say, cell A7) to automatically change to the next consecutive number each time I open the file. Is there a way to do that?

  2. #2
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    I am considering that cell a7 that you want to increment is in Worksheet Sheet1.


    paste the below code in "This Workbook" in vba editor.

    Private Sub Workbook_Open()
    Worksheets("Sheet1").Range("a7").Value = Worksheets("Sheet1").Range("a7").Value + 1
    End Sub

  3. #3
    Registered User
    Join Date
    05-13-2005
    Posts
    12
    Thanks, Anil. I'll hang on to this; I also have another idea that mimics another project I was doing before that I think will work, too.

  4. #4
    Tom Ogilvy
    Guest

    Re: consecutive numbers

    Won't that change each time you open the workbook. so when you first enter
    the purchase order, it will be number 1. Then the next time you look at or
    edit it it will be number 2 and the next time number 3.

    --
    Regards,
    Tom Ogilvy

    "amyenoch" <amyenoch.1pydmi_1117638315.9566@excelforum-nospam.com> wrote in
    message news:amyenoch.1pydmi_1117638315.9566@excelforum-nospam.com...
    >
    > Thanks, Anil. I'll hang on to this; I also have another idea that
    > mimics another project I was doing before that I think will work, too.
    >
    >
    > --
    > amyenoch
    > ------------------------------------------------------------------------
    > amyenoch's Profile:

    http://www.excelforum.com/member.php...o&userid=23337
    > View this thread: http://www.excelforum.com/showthread...hreadid=375620
    >




  5. #5
    Tom Ogilvy
    Guest

    Re: consecutive numbers

    http://www.mcgimpsey.com/excel*/udfs...ntialnums.html


    --
    Regards,
    Tom Ogilvy

    "amyenoch" <amyenoch.1pyaur_1117634723.7517@excelforum-nospam.com> wrote in
    message news:amyenoch.1pyaur_1117634723.7517@excelforum-nospam.com...
    >
    > I'm creating a purchase order form in Excel. I would like the purchase
    > order number (in, say, cell A7) to automatically change to the next
    > consecutive number each time I open the file. Is there a way to do
    > that?
    >
    >
    > --
    > amyenoch
    > ------------------------------------------------------------------------
    > amyenoch's Profile:

    http://www.excelforum.com/member.php...o&userid=23337
    > View this thread: http://www.excelforum.com/showthread...hreadid=375620
    >




+ 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