+ Reply to Thread
Results 1 to 2 of 2

Number Tracking System

  1. #1
    Registered User
    Join Date
    07-22-2010
    Location
    Ontario
    MS-Off Ver
    Excel 2003
    Posts
    71

    Number Tracking System

    Hi there,

    I need your help in designing a function that would check and see if an existing value in Cell A, starting from Cell A2 downwards already exists, (eg. 2010-000001).

    If (2010-000001) already exists, then go ahead and input a new number: 2010-000002 and so fourth.

    Basically, I have a userform designed, and when I click on "Add a Record" it would then populate the Cell A3 with the new value (eg. 2010-000002)

    Sounds complicated and I really need the help of the Excel VBA Guru's out there.

    Much thanks and appreciation for everything in advance,

    Cheers,

    Jason

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Number Tracking System

    Quote Originally Posted by jason_kelly View Post
    ...check and see if an existing value in Cell A, starting from Cell A2 downwards already exists, (eg. 2010-000001).

    If (2010-000001) already exists, then go ahead and input a new number: 2010-000002 and so fourth.
    Basically, I have a userform designed, and when I click on "Add a Record" it would then populate the Cell A3 with the new value (eg. 2010-000002)
    The first part of your description (first quote) isn't clear when I look at the second part of your description (second quote).

    In the first part, it looks like you are checking a value in a cell, and if it exists in any other rows, change it to a new number that doesn't yet exist.

    In the second part, it looks like you are simply generating a new number to use in the last row, period.

    Do numbers appear multiple times in your sheet? Are they sorted in any particular way? Can you attach a sample?

    The second part is clearer. Because the "-" embedded in your serial number makes it a string instead of a number, that adds a little bit of extra work. I would suggest you create a hidden sheet to store the latest serial number (the part after the year), and to create a new serial number increment it and concatenate to "2010-". You will need some additional code to handle the year rollover (I am assuming that it's not just a coincidence that the numbers start with "2010").
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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