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
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.
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?
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?
"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.
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.
Frank, thank you for your understanding in this (mess of a?? lol) thread.
Ali just showed me your PM discussion.
Maybe to begin with, but after your explanation, all is right in the world again :0...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. ...
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?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.
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
Thank you for your response. There isn't anything that needs to be carried over.
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks