Randomize

H

Helmut Weber

Hi Ulf,
the following applies to capital letters A..Z
Dim i As Integer
Dim c As Integer
Randomize
For i = 1 To 200
c = Int((90 - 65 + 1) * Rnd + 65)
Debug.Print Chr$(c)
Next
Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr$(64) & "t-online.de"
 
U

Ulf Nilsson

Hi Helmut,

What about letters not between A..Z, such as Swedish
letters - ÅÄÖ.

/ Ulf
 
M

martinique

Create an array of all the characters you want to choose from: eg Chars(1 to
n).

Use Helmut's algorithm or something similar to get a random value (1 to n)
and use that as am index into your array:

C = Chars(Int(n * Rnd + 1))




Hi Helmut,

What about letters not between A..Z, such as Swedish
letters - ÅÄÖ.

/ Ulf
 
Top