Excel VBA code to generate alphanumeric serial number

What does this code do?

This code generates an alphanumeric string with length minimum of 4 and a maximum of 16 characters long. It also gives different string options like,

Alphabets only - bznIypDNKJ

Alphanumeric only - 1LiIXeSdW1

Alphanumeric with sysmbols only - !ifG9TG@Ma

Symbols only - &*$^!@#$%^

Another option in this excel project is that you can insert string intervals, which looks like a typical product key or serial numbers. You can turn on or off by selecting "yes" or "No".

You can generate only one or multiple strings up to 250 rows using the populate string button. For this, you have to mention the number of times the string to be generated in the print list cell.

Examples of generated string


Populate List:

How does this code work?

The first step is designing UI for the project like adding string options like string length, string type, interval, and print list fields and buttons.

Secondly, adding data validation to these options fields is very important as it notifies the users with errors in their inputs.

alphanumeric-serial-number-generator alphanumeric-serial-number-generator

Once the basic things are done, now creating the actual logic to the buttons - Generate and populate string.

Hope you liked this article, if so please share it with your friends.

This project is available for download in the link below,Try experimenting with this code to get clarity.

Excel Logo

Download project file

Share on:
Most Popular