K0st4din
Well-known Member
- Joined
- Feb 8, 2012
- Messages
- 501
- Office Version
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hi all, after a lot of searching I managed to find something similar on the site that comes close to what I want to do.
www.mrexcel.com
But since I don't understand anything, I can't even modify it for my needs, I am asking for your macro help.
I will attach my excel file.
I want to generate random serial numbers and in different situations with different character lengths ie 12 or 14 or 16 or 18.
In cell I2 I have made a drop down menu to choose how many characters to be. In cell J2 - what type should they be (ie Only uppercase letters and numbers, only numbers or lowercase, uppercase and numbers, or some of my choice of selected characters, etc.).
In cell K2, I record how many Countless combinations to generate according to the choices made that start from/in cell A1 to the end (just an example: be it 3, 34569 or 1 million).
Here it comes (and what I was able to find on the site) is to be able in the second worksheet (with some name given by me) to be able to accumulate a base, with already generated combinations, so that there is never repetition in the new ones generated.
Since I have no idea if the macro can add columns, I have made several of the different types of combinations, be it 12, 14, 16 or 18. If after the first column is filled, the macro can add a new column with the search criteria, then it will make no sense for me to put columns for each type (but I leave this as a last touch, to have your say).
I would be extremely grateful if you could help me.
One more thing, in the link where I found a similar solution, there the user requires to have some hyphens, in my case, I don't need them, that is, I need something like this: for example: ODN81T6DRJJY8S or ODN81T6DRJJY8S49 or 068249317896) i.e. is without any signs.
Thanks in advance to each one!
![www.mrexcel.com](https://www.mrexcel.com/board/styles/mrexcel/mrexcel-logo-og.png)
Macro to generate random serial number
Hi guys, I need to generate some serial number to provide to our students and I'm looking for a macro to do it. Ideally, I enter in cell A1 the number of key code to generate and it will generate those in the following format: 3XA7-BC6D-98EF Can mix letter (Capital only) and number. But should...
But since I don't understand anything, I can't even modify it for my needs, I am asking for your macro help.
I will attach my excel file.
I want to generate random serial numbers and in different situations with different character lengths ie 12 or 14 or 16 or 18.
In cell I2 I have made a drop down menu to choose how many characters to be. In cell J2 - what type should they be (ie Only uppercase letters and numbers, only numbers or lowercase, uppercase and numbers, or some of my choice of selected characters, etc.).
In cell K2, I record how many Countless combinations to generate according to the choices made that start from/in cell A1 to the end (just an example: be it 3, 34569 or 1 million).
Here it comes (and what I was able to find on the site) is to be able in the second worksheet (with some name given by me) to be able to accumulate a base, with already generated combinations, so that there is never repetition in the new ones generated.
Since I have no idea if the macro can add columns, I have made several of the different types of combinations, be it 12, 14, 16 or 18. If after the first column is filled, the macro can add a new column with the search criteria, then it will make no sense for me to put columns for each type (but I leave this as a last touch, to have your say).
I would be extremely grateful if you could help me.
One more thing, in the link where I found a similar solution, there the user requires to have some hyphens, in my case, I don't need them, that is, I need something like this: for example: ODN81T6DRJJY8S or ODN81T6DRJJY8S49 or 068249317896) i.e. is without any signs.
Thanks in advance to each one!
Test serial numbers.xlsm | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | |||
1 | ? Combination | Select model letters and numbers | How many numbers you need | 12 | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 | |||||||||||||
2 | 14 | ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 | 987254 | 14 | ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 | |||||||||||||
3 | 16 | abcdefghijklmnopqrstuvwxyz0123456789 | ||||||||||||||||
4 | 18 | 0123456789 | ||||||||||||||||
5 | ||||||||||||||||||
6 | ||||||||||||||||||
7 | ||||||||||||||||||
8 | ||||||||||||||||||
9 | ||||||||||||||||||
10 | ||||||||||||||||||
generate numbers |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
I2 | List | =$N$1:$N$5 |
J2 | List | =$O$1:$O$11 |
Test serial numbers.xlsm | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |||
1 | 12 | 12 | 12 | 12 | 12 | 12 | 12 | 12 | 14 | 14 | 14 | 14 | 14 | 14 | 14 | 14 | 16 | 16 | 16 | 16 | 16 | 16 | 16 | 16 | ||||
2 | ||||||||||||||||||||||||||||
3 | ||||||||||||||||||||||||||||
4 | ||||||||||||||||||||||||||||
5 | ||||||||||||||||||||||||||||
6 | ||||||||||||||||||||||||||||
7 | ||||||||||||||||||||||||||||
8 | ||||||||||||||||||||||||||||
9 | ||||||||||||||||||||||||||||
10 | ||||||||||||||||||||||||||||
11 | ||||||||||||||||||||||||||||
12 | ||||||||||||||||||||||||||||
13 | ||||||||||||||||||||||||||||
14 | ||||||||||||||||||||||||||||
15 | ||||||||||||||||||||||||||||
16 | ||||||||||||||||||||||||||||
17 | ||||||||||||||||||||||||||||
18 | ||||||||||||||||||||||||||||
19 | ||||||||||||||||||||||||||||
20 | ||||||||||||||||||||||||||||
21 | ||||||||||||||||||||||||||||
22 | ||||||||||||||||||||||||||||
23 | ||||||||||||||||||||||||||||
24 | ||||||||||||||||||||||||||||
25 | ||||||||||||||||||||||||||||
base generated numbers |