Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Spinning Numbers

Thanks to Rocky for the following Macro to select and spin
a random number for a raffle. However, a couple of
questions. Will the routine include 1 and 100 in the draw
and secondly can any numbers be input ie, 87000 to 87500
Regards
Michael

Option Explicit
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)
Sub SpinNumber()
Dim X As Integer
For X = 1 To 99
Range("I8") = Int((100 * Rnd) + 1)
Sleep 10
Next X
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Spinning Numbers

To randomize range of numbers use it:

Sub SpinNumber_1()
'Int((up_number - down_number + 1) * Rnd + down_number)
Dim X As Integer
For X = 1 To 20
Range("I" & X) = Int((87500 - 87000 + 1) * Rnd +
87000)
Sleep 10
Next X
End Sub

-----Original Message-----
Thanks to Rocky for the following Macro to select and

spin
a random number for a raffle. However, a couple of
questions. Will the routine include 1 and 100 in the draw
and secondly can any numbers be input ie, 87000 to 87500
Regards
Michael

Option Explicit
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)
Sub SpinNumber()
Dim X As Integer
For X = 1 To 99
Range("I8") = Int((100 * Rnd) + 1)
Sleep 10
Next X
End Sub


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM
to find missing serial numbers in randomly generated numbers B.H. Hadi Excel Worksheet Functions 2 December 1st 05 10:56 PM
Insert spinning button with time format in Excel 2000? Pat Hughes Excel Discussion (Misc queries) 5 October 27th 05 12:55 AM
Spinning numbers Michael[_23_] Excel Programming 1 December 24th 03 06:31 AM


All times are GMT +1. The time now is 04:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"