Advertisement
Guest User

Random Powerpoint Number Generator

a guest
Aug 14th, 2014
2,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub UpdateRandomNumber(oSh As Shape)
  2. Dim X As Long
  3. 'Make the shape’s text generate a random number less than or equal to the value of X
  4. X = 16
  5. oSh.TextFrame.TextRange.Text = CStr(Random(X))
  6. 'The below forces the PowerPoint to refresh the slide so that the dice is rerolled
  7. SlideShowWindows(1).View.GotoSlide (SlideShowWindows(1).View.Slide.SlideIndex)
  8.  
  9. End Sub
  10.  
  11. Function Random(High As Long) As Long
  12. 'Generates a random number less than or equal to the number X identified above
  13. Randomize
  14. Random = Int((High * Rnd) + 1)
  15. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement