Closed Thread
Results 1 to 26 of 26

Auto generating work order number

Hybrid View

  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    Bel Air, MD
    Posts
    10

    Auto generating work order number

    I am using Excel to produce work orders and I need each one to have its own unique number. Much like an invoice or contract number, each time I open the file I would like Excel to generate a new number for that spreadsheet with a value of 1 more than the previous spreadsheet. Does anyone know if this is possible?

  2. #2
    Registered User
    Join Date
    02-29-2008
    Posts
    15

    How does this work?

    There's a question here about knowing what the new work order number is.

    How would anybody - you, me or excel; know the number of the previous work order?

    For example - if you're creating work order 52. How would we know that work order 51 exists? Do you file them in a particular directory on your PC or is there some sort of central log?

    If there's no system like this, it's very hard for anyone to generate a new work order number.

    Let me know.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    This is frequently asked, and there are several ways to do it.
    • If numbers are assigned only on your computer,
    • You can create a registry key that you increment each time you need a new number.
    • You can use an ad-hoc add-in that stores the number on a hidden sheet.
  4. You can use an ad-hoc workbook or text file on your machine or a network share. For a workbook, open the file, grab the number, increment it and save the file. For a text file, open for read access, get the number, close the file, open for write access, increment the number, close the file.
  5. Depending on your level of experience, the easiest implementaion is the registry, and the most complex in the add-in.
Last edited by shg; 07-02-2008 at 03:39 PM.
Reply With QuoteRegister To Reply

  • #4
    Registered User
    Join Date
    07-02-2008
    Location
    Bel Air, MD
    Posts
    10
    Shg,

    Yes, that's what I would like to do. Please tell me how. I have a little experience with Excel but my knowledge is not that broad.

  • #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Which one?

  • #6
    Registered User
    Join Date
    07-02-2008
    Location
    Bel Air, MD
    Posts
    10
    The easiest. Although I may have to have multiple users use the same spreadsheet, I would like to figure out how to do it on my own system first.

  • #7
    Registered User
    Join Date
    10-24-2016
    Location
    LAGOS
    MS-Off Ver
    2016 OFFICE 365
    Posts
    1

    Re: Auto generating work order number

    I used the codes as advised but i am having an issue with the numbering and would it be possible to stop the sequence or how best to start from the scratch

  • #8
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    274

    Re: Auto generating work order number

    Rather than trying track the last ticket number and increment it which has to be stored somewhere reliable between when the system is shut down and restarted , i use the date and time to assign a ticket number which ensures I never get a duplicate ticket number. The ticket number is dependend on the date and time to the 6th decimal place. Depending on the expected minimum length of time between your program assigning work order nos, you can change the granularity up or down by changing the 6.

    Function AssignWONumber() as string
    dim dtserial as long, tmserial as double, i as integer
    dtserial = DateValue(a): tmserial = TimeValue(a)
    i = InStr(str(tmserial), ".")
    AssignWoNumber = Trim(str(dtserial)) + Mid(str(tmserial), i + 1, 6)
    exit function

  • #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,438

    Re: Auto generating work order number

    I was shocked to see when I opened the template one day that the number had increased by 10. Is their opening the *.xls file on their system also increasing the number?
    Yes.

    Keep the process manual to eliminate your headaches. May not be as elegant but its functional.
    Attached Files Attached Files

  • #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,960

    Re: Auto generating work order number

    bello_e, EssoExplJoe, Logit,

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

  • #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,438

    Re: Auto generating work order number

    protontLeah:

    Must be a server issue. When I posted my response it was immediately after Shmoedoe's #15 post. I specifically recall because his comment
    Is their opening the *.xls file on their system also increasing the number?
    was what prompted me to respond.

    Unusual that three different people would post to the wrong thread ... hmmm

  • #12
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,960

    Re: Auto generating work order number

    Auto generating work order number
    Started by Shmoedoe‎, 07-02-2008 05:45 AM

  • 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