View Single Post
 
Old 08-11-2012, 07:49 AM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Note though that will generate a number between 1 and 12.

To get what you said you would need to pass the High and the Low values

Code:
Sub UpdateRandomNumber(oSh As Shape)
oSh.TextFrame.TextRange.Text = CStr(Random(100, 25))
SlideShowWindows(1).View.GotoSlide (SlideShowWindows(1).View.Slide.SlideIndex)
End Sub

Function Random(High As Long, Low As Long) As Long
Randomize
Random = Int((High - (Low - 1)) * Rnd) + Low
End Function
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote