China Naming Network - Eight-character lottery - How do you use VBA in Excel2003 to randomly display the numbers in 1-20 in the text box every 0. 1 sec? Thank you.

How do you use VBA in Excel2003 to randomly display the numbers in 1-20 in the text box every 0. 1 sec? Thank you.

Define 1 variable m=0,

When the button is pressed, the value of m becomes 1.

Add a for loop in the middle of the do while(m==0) loop to realize the delay of 0. 1 second (execute some useless statements that waste time), and use int(rnd()*20) to randomly extract the number of 1 from 1 to 20 and assign it to the text box.

I hope it helps you, thank you!