RandomGUID

Creates a random GUID number
like ...
879AE395-E026-0A63-EFC1-152038C4400B
E79CC0E4-1216-8B6B-B276-0C5F1A0AAC20
021822AD-9CF2-3B54-F134-639480E6022F

CodeFunctionName
What is this?

Public

Tested

Original Work
Function RandomGUID()
MaxChars = 32 ' 32 chars
strChars = "ABCDEF1234567890"
strRnd = ""
' 8 - 4 - 4 - 4 - 12
Randomize Timer
For I = 1 To 8
strRnd = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
Next
strRnd = strRnd & "-"
For I = 1 To 4
strRnd = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
Next
strRnd = strRnd & "-"
For I = 1 To 4
strRnd = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
Next
strRnd = strRnd & "-"
For I = 1 To 4
strRnd = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
Next
strRnd = strRnd & "-"
For I = 1 To 12
strRnd = strRnd & Mid(strChars, Int((Len(strChars) * Rnd) + 1), 1)
Next
RandomGUID = strRnd
End Function

Views 1,258

Downloads 445

CodeID
DB ID

ANmarAmdeen
593
Attachments
Revisions

v1.0

Wednesday
December
18
2019