PDA

View Full Version : Selecting a Random Statement



Kmac182
03-12-2007, 09:17 AM
Hello.

I was hoping for some help on the code for selecting a random line. Is there a command that will randomly select a from a list of statements?

I tried the Choose (i, a, b, c, d) command, but it didn't get me what I wanted.

ex.)
a = "Random 1"
b = "Random 2"
c = "Random 3"
d = "Random 4"

TextBox1 = (Randomly select either a, b, c, or d)

Thanks in advance!

Bob Phillips
03-12-2007, 11:20 AM
MsgBox Application.Index(Range("A1:A4"), Int(Rnd() * 4 + 1))