+ Reply to Thread
Results 1 to 7 of 7

Creating a unique reference number

  1. #1
    Registered User
    Join Date
    03-17-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Creating a unique reference number

    Hi there,

    Sorry to launch straight into a query, but I was hoping someone out there might be able to help me, I don't know the first thing about coding, and have reached the limit of my skill...

    I have attached my work so far, but I have reached a dead end.... I am creating a logbook to record the booking out of items, and where they go. Each row is a different record, and I need each row to have a unique reference number. The items are booked out to 3 separate locations (London, Birmingham, Scott Wilson) and I will need the ref. numbers to start LDN, BRM, and WIL according to where they have been booked out to, then a non repeating 4 digit number (0001, 0002 etc).

    I realise I haven't explained myself too clearly, but any assistance would be greatly appreciated!
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Creating a unique reference number

    Hi and welcome to the forum

    Im sure some-one can come up with a suggestion for you, but it would make things easier if you include some dummy data, and a few samples of your expected outcome?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: Creating a unique reference number

    Here's my crack at it.

    I've added another column to your "Behind the Scenes" worksheet to provide a lookup table for the 3letter codes.


    EDIT: Ignore this attachment. Corrected version in the next post. Sorry!
    Attached Files Attached Files
    Last edited by Spencer101; 03-17-2013 at 10:35 AM.
    If I've been of help, please hit the star

  4. #4
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: Creating a unique reference number

    Apologies, there was a slight error in the previous attachment.

    Fixed in this version.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-17-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Creating a unique reference number

    Hi Spencer,

    That's great, thank you! Is there any way to make it work so that when I use the 'booking form' to enter the details? If I cancel the booking form at enter manually it works great, but if I use the booking form to enter the details, once I press enter the data is inputted in the first row where there is no formula in the A column... (ie at the very bottom of the spreadsheet)

    Would it help if I posted the code from the booking form? If I created some additional code, could the reference number be created that way?

    Sorry for being quite so dense, I really have no idea what I'm doing!

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Creating a unique reference number

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    03-17-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Creating a unique reference number

    Woohoo! Thank you Norie!

+ 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