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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Randomizer 1
How random is Rnd 12
Page sort 0
Randomize statement 5
Is there something wrong with the random generator in Excel? 14
randomize a list 1
Randomize pages in word 1
Randomize the animation sequence 4

Top