If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Random number
In article , Alec Stonehouse wrote:
HI Group, I want PPT to generate a random number (between 1 and 20) on a buton click. I have never tried using VBA and suspect this is the only way to do it. If a kind person has any ideas and lots of patience, I would love to hear from you. Sub MakeARandomNumber() Dim MaxNumber As Long ' Edit this to be the highest number you're willing to accept MaxNumber = 42 Randomize ' Initialize random-number generator. MsgBox (Int(MaxNumber * Rnd) + 1) End Sub That's the code. Have a read here to learn ... er ... where to stick it. ;-) How do I USE this VBA stuff in PowerPoint? http://www.rdpslides.com/pptfaq/FAQ00033.htm -- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com |
#2
|
|||
|
|||
Random number
Check out Examples 8.13 through 8.17 on my web site:
http://www.loyola.edu/education/PowerfulPowerPoint/ Click on Examples by Chapter and click on Chapter 8 to find the examples. These examples use random numbers in VBA in a variety of ways. --David David M. Marcovitz Author of _Powerful PowerPoint for Educators_ http://www.loyola.edu/education/PowerfulPowerPoint/ |
#3
|
|||
|
|||
Random number
Thanking you all. I am on a big journey I think.
"David M. Marcovitz" wrote in message news Check out Examples 8.13 through 8.17 on my web site: http://www.loyola.edu/education/PowerfulPowerPoint/ Click on Examples by Chapter and click on Chapter 8 to find the examples. These examples use random numbers in VBA in a variety of ways. --David David M. Marcovitz Author of _Powerful PowerPoint for Educators_ http://www.loyola.edu/education/PowerfulPowerPoint/ |
Thread Tools | |
Display Modes | |
|
|