+ Reply to Thread
Results 1 to 5 of 5

Non-relative Unique record ID

  1. #1
    Registered User
    Join Date
    03-31-2009
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Non-relative Unique record ID

    OK, this one should be fairly easy, but i'm struggling to get my head around how to achieve it. i'm creating a spreadsheet with records of repair jobs on vehicles that my company is/has performed. the problem is that, the way our system works, there are currently no unique identifiers for jobs, meaning i cannot create a master list with various vlookup tables with only the information relevant for our engineers on them.

    is it possible to create a macro or use some other system, that will create a new, unique code when a line/cell is filled in? because we end up sorting the list by different criteria on a regular basis (to find specific jobs) the system can't be relative (i.e. +1 to the code above).

    i'm sure there must be a way, but i can't see what it would be. can anyone help?
    Last edited by admiraldick; 05-08-2009 at 09:18 AM. Reason: problem solved

  2. #2
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Stellenbosch, South Africa
    MS-Off Ver
    Excel 2003; Excel 2007; Excel 2010; Excel 2013
    Posts
    136

    Re: Non-relative Unique record ID

    Hello

    Perhaps something like the code below. You need to double click the corresponding cell in column A for it to assign the ID.

    Right click the sheet tab that should hold the ID's.
    Click View Code
    Paste this into the Editor
    Close the Editor

    Please Login or Register  to view this content.
    Regards

    Jon (Excel 2003, 2007, 2010, 2013)

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Non-relative Unique record ID

    that code works but if the sheet is sorted on another column
    the next double click will create a number based on the cell above it thus creating duplicates
    perhaps a small change to the code could be

    Please Login or Register  to view this content.
    Last edited by martindwilson; 05-08-2009 at 05:00 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Stellenbosch, South Africa
    MS-Off Ver
    Excel 2003; Excel 2007; Excel 2010; Excel 2013
    Posts
    136

    Re: Non-relative Unique record ID

    Good spot Martin, welcome improvement

  5. #5
    Registered User
    Join Date
    03-31-2009
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Non-relative Unique record ID

    thanks guys. as always, that is exaclty what i'm looking for!

+ 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