Forum Discussion

LukeA79's avatar
LukeA79
Copper Contributor
Nov 28, 2019
Solved

Create a Unique Code Generator with Excel

Hi folks!   SO, I am stuck trying to create a simple Excel worksheet (using Excel 2019) to allow me to create a unique identifier every time a button is pressed.   These are my requirements: Th...
  • alandorss's avatar
    Nov 28, 2019

    LukeA79 Hi, Why does the identifier need to be random?

    If it doesnt, just extract the numbers, find the max and add 1, and error out when you hit the max. Since you know the format allowed, theres no need to have a list of available numbers.
    Alternatively,

    Create vba code to pull all used names, extract the numbers into an array, sort ascending, loop 49998 times and quit when you find an unused number.

    Let me know if you need any more help.

Resources