Hi,
How can I create a random number in a textbox between 1 and 1000?
Printable View
Hi,
How can I create a random number in a textbox between 1 and 1000?
you would have to use the RND statement
and that is.........?
Can you make a code for me please? :bigyello:
VB Code:
form_load() randomize end sub command1_click() rnd (1 - 1000) end sub
i think thats right, or try 1 * 1000
ok thanks,
Text1.Text = Rnd
Just what I need.
VB Code:
randomize ' seed random number generator text1.text = int((rnd * 1000) + 1) ' pick random integer between 1 and 1000
this is what you need to use.
YES!
That's exactly what I want.
Thanks! :wave:
That's what I thought. :wave:
yea u need INT(rnd......) to knock off the decimal places since the randomize function does 0-1 but not the whole # 1
randomize **** is fun to play with... i wrote a program that randomizes the back color of the form every milisecond...set it do do 0 - 999999(hexicode for colors and **** thats y theirs 6)
Quote:
Originally Posted by dglienna
text1.text = int((rnd * 1000) + 1) ' pick random integer between 1 and