Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 01-04-2013, 06:03 AM
gmaxey gmaxey is offline Is there no wdOrange colorindex variable? Windows 7 32bit Is there no wdOrange colorindex variable? Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Jennifer,

You will eventually get a 255 if you use 255. Try this:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim i As Long
Dim lngRandom As Long
Do
  i = i + 1
  lngRandom = CLng(Rnd() * 255)
  If lngRandom = 255 Then
    MsgBox "Bingo!  In " & i & " loops you reached max value."
    Exit Do
  End If
Loop
End Sub
Personally, I don't think it matters that much if you use an integer or long variable.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there no wdOrange colorindex variable? Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM
Is there no wdOrange colorindex variable? variable Page references scrinmemphis Word 4 06-06-2012 11:50 PM
Is there no wdOrange colorindex variable? Capture a Font in a Variable joatmon Excel Programming 1 05-30-2012 08:23 PM
Help with VBA macro - Variable input sc30317 Excel Programming 0 08-31-2011 01:00 PM
Variable fields? Emalee77 PowerPoint 0 01-30-2011 05:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:22 AM.


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