Question
3. In Excel worksheet, use an Active X command button. This button will generate random numbers between 0 and 1,000 in cells A1:E20. Note, put
3. In Excel worksheet, use an Active X command button. This button will generate random numbers between 0 and 1,000 in cells A1:E20. Note, put your command button in an area to the right of column E. The button should have a caption of "Random Number Generator" and be named cmdRandomNumber. The VBA code needed to generate the numbers is as follows.
Const rowmax As Long = 20
Const colmax As Long = 5
Dim r As Long, c As Long
For r = 1 To rowmax
For c = 1 To colmax
Cells(r,c) = Int(Rnd * 1000)
Next c
Next r
Reference: https://www.youtube.com/watch?v=NisHUnn-PZo
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started