G Guest Oct 26, 2006 #1 Need to no how to program dice to randomly generate instead of numbers words on the click of a button.
Need to no how to program dice to randomly generate instead of numbers words on the click of a button.
G Guest Oct 26, 2006 #2 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
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
G Guest Oct 26, 2006 #3 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
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