Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need to no how to program dice to randomly generate instead of numbers words
on the click of a button. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First create the button in the usual way and assign the following macro to it:
Sub dice() Dim s(6) As String s(0) = "one" s(1) = "two" s(2) = "three" s(4) = "five" s(5) = "six" v = Round(Rnd() * 5) MsgBox (s(v)) End Sub -- Gary's Student "Spud" wrote: Need to no how to program dice to randomly generate instead of numbers words on the click of a button. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry the previous dice were loaded. Use this instead:
Sub dice() Dim s(6) As String s(0) = "one" s(1) = "two" s(2) = "three" s(3) = "four" s(4) = "five" s(5) = "six" v = Round(Rnd() * 5) MsgBox (s(v)) End Sub -- Gary''s Student "Spud" wrote: Need to no how to program dice to randomly generate instead of numbers words on the click of a button. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dice roll "problem" | Excel Discussion (Misc queries) | |||
How do I mimic random dice rolls in a sheet | Excel Discussion (Misc queries) | |||
Probabilities, random numbers and dice throws | Excel Worksheet Functions | |||
programming a dice roll | Excel Programming | |||
Probability of dice throws | Excel Programming |