Glad you have it working. Looks good.
Update: Here is a small function to get alpha characters
Code:
'---------------------------------------------------------------------------------------
' Procedure : randomalpha
' Author : mellon
' Date : 12/10/2015
' Purpose : Returns random alpha characters based on your HowManyChars value
'---------------------------------------------------------------------------------------
'
Function randomalpha(HowManyChars As Integer) As String
Dim a As Integer
Dim z As Integer, i As Integer
Dim str As String
Dim ralpha As Variant
Dim Result As String
10 On Error GoTo randomalpha_Error
20 a = 1
30 z = 26
40 str = "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"
50 ralpha = Split(str, " ")
60 For i = 1 To HowManyChars
70 Result = Result & ralpha(randomNumber(a, z) - 1)
'Debug.Print Result
80 Next i
90 randomalpha = Result
100 On Error GoTo 0
110 Exit Function
randomalpha_Error:
120 MsgBox "In Line " & Erl & " Error " & Err.number & " (" & Err.Description & ") in procedure randomalpha of Module AccessMonster"
End Function
and a test routine
Code:
Sub testRandomAlpha()
Debug.Print randomalpha(4)
End Sub