Hello drdavidge,
This macro is a UDT (User Defined Funfction). This can be used on a worksheet or in VBA code. It produces a Globally Unique IDentifier string.
According to Microsoft...
A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated.
From Wikipedia...
While each generated GUID is not guaranteed to be unique, the total number of unique keys (2^128 or 3.4×10^38) is so large that the probability of the same number being generated twice is very small. For example, consider the observable universe, which contains about 5×10^22 stars; every star could then have 6.8×10^15 universally unique GUIDs.
Macro Code
Copy this code into a VBA standard module.
VBA Usage Example
Running this code in VBA will produce a GUID and store it in the string variable S
Worksheet Example
Place the formula =GetGUID() in a cell. The cell will hold a GUID.
Bookmarks