+ Reply to Thread
Results 1 to 9 of 9

Creating a new tracking number with every new page

  1. #1
    Registered User
    Join Date
    04-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Creating a new tracking number with every new page

    I want excel to create a unique identifying number in cell "k1" every time I copy or add a worksheet.

    I would prefer it be between 18001 and 18999
    Last edited by frankday; 08-10-2018 at 06:09 PM.

  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,705

    Re: creating random tracking numbers

    Do you mean random sheet names, or random numbers within each sheet? If you don't want the numbers to repeat, that's not truly random, but I know what you mean. You will need VBA for that. Can you describe your situation in more detail?

    What is the event that triggers creating a new tracking number? How are they used? What is the range of numbers you want to use?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: creating random tracking numbers

    Thanks for getting back to me.

    I have 100 sheet that look all the same but the data information on them are all different. I essentially want a different tracking number on each sheet. Maybe it starts on the first sheet at 1000 and each time I add a sheet it goes to the next number. 1001,1002,1003 and so on. Never repeating itself.

    Each sheet has a list of 8 items each with a unique S/N. I want to have a number for each sheet that will link it to the box that has those 8 items in it.

    Does that help?

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

    Re: creating random tracking numbers updated 14:14

    "Maybe it starts on the first sheet at 1000 and each time I add a sheet it goes to the next number. 1001,1002,1003 and so on. "

    That's not random. Do you mean "unique"?

    In your first post you specify starting at 18000, but then you give an example of 1000. How do you determine what starting number to use?

    This can done using the NewSheet event in ThisWorkbook, but I would like to nail down the numbering scheme before putting effort into writing code.

  5. #5
    Registered User
    Join Date
    04-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: creating random tracking numbers updated 14:14

    Thanks for your time, I want to start with 18 because it will represent the year. I will have more then 99 sheets in a year, that's how I came up with the three zeros after. The numbers can be consecutive or random it doesn't matter. I'm going to have the sheets locked, that's why I would like it to do it everytime they copy to a new sheet. If it doesn't work that way, maybe a button would be the better way to go. If all else fails.

    I have attached a sample of the spread sheet.
    Attached Files Attached Files

  6. #6
    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
    52,926

    Re: creating random tracking numbers updated 14:14

    Frank, thank you for your understanding in this (mess of a?? lol) thread.

    Ali just showed me your PM discussion.
    ...I really do apologize I created a hell of a mess. Thanks for you help resolving this, I hope the other aren't to pissed. ...
    Maybe to begin with, but after your explanation, all is right in the world again :0
    I have created a big mess with my posted that I didn't intend to do. I have made things very confusing for everyone. I honestly didn't know how to clean it up and this was a very failed attempt. It would be great if you could delete all my posts dealing with these two issues. so I could start over. There was a couple people trying to help me but I think they where lost and gave up.
    You indicated in the PM that there where threads to be closed. Without going into them (I will if needed) are there any that need info carried over to here?
    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

  7. #7
    Registered User
    Join Date
    04-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: creating random tracking numbers updated 14:14

    Thank you for your response. There isn't anything that needs to be carried over.

  8. #8
    Registered User
    Join Date
    04-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Creating a new tracking number with every new page

    I am still hoping someone can help me solve this problem. There is a sample file attached.

    I was asked why I started with 18. I used 18 for the year.

    Thanks for any assistance

  9. #9
    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
    52,926

    Re: Creating a new tracking number with every new page

    Quote Originally Posted by frankday View Post
    I want excel to create a unique identifying number in cell "k1" every time I copy or add a worksheet.

    I would prefer it be between 18001 and 18999
    This will require VBA, so I will move this to that forum for you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating random numbers for bingo games
    By dcbeagle in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-11-2018, 01:39 PM
  2. [SOLVED] Creating controlled random numbers across multiple columns
    By terryhenderson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-27-2016, 12:20 PM
  3. [SOLVED] creating and re-creating 'random' numbers from a specific seed that can be recreated
    By OberonViking in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-15-2014, 04:13 PM
  4. Creating random numbers that add up to a specific number
    By PapaCheese in forum Excel General
    Replies: 1
    Last Post: 06-13-2012, 07:00 PM
  5. Replies: 4
    Last Post: 05-15-2010, 06:57 PM
  6. Creating Random numbers in Excel problem
    By mrosendal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2008, 08:37 AM
  7. creating random numbers
    By pikachiu132 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2005, 01:55 AM

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