is there a way to generate random letters in vb?
i did it by assigning each letter to a number (1=a, 2=b...) but i want to know if there's an easier way
Printable View
is there a way to generate random letters in vb?
i did it by assigning each letter to a number (1=a, 2=b...) but i want to know if there's an easier way
You could do the following.
:)VB Code:
Dim Letter As Integer Randomize Letter = Int((26 * Rnd) + 65) Text1 = Chr$(Letter)
VB Code:
Private Sub Command1_Click() Dim RanLetter As String Dim Position As Integer RanLetter = "abcdefghijklmnopqrstuvwxz" Randomize Position = CInt(Rnd() * 25) + 1 Text1.Text = Mid(UCase(RanLetter), Position, 1) End Sub