Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 08-11-2012, 07:49 AM
JohnWilson JohnWilson is offline Randomly generate numbers, Macro? Windows 7 64bit Randomly generate numbers, Macro? 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to recap data of same numbers Jasa P Word VBA 0 06-28-2012 02:41 AM
Randomly generate numbers, Macro? Formatting changing randomly Franuzz Word 1 07-14-2011 04:12 PM
black text randomly changing to white when run macro G DeBree PowerPoint 0 03-16-2011 09:23 AM
Randomly delayed emails Colinest84 Outlook 1 01-14-2011 02:32 AM
Documents Randomly Corrupting the IT Guy Word 0 02-06-2009 09:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft