PC Review


Reply
 
 
=?Utf-8?B?U3B1ZA==?=
Guest
Posts: n/a
 
      26th Oct 2006
Need to no how to program dice to randomly generate instead of numbers words
on the click of a button.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      26th Oct 2006
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.

 
Reply With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      26th Oct 2006
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ke dice     *eLmEr & Šenisita hMaNiToZz 4 eVeR(K)(6)Prom07 Microsoft Access 0 7th May 2009 06:22 AM
Still no dice w/ email sending Hurricane434 Windows Vista Mail 14 3rd Jan 2008 02:51 AM
animated dice RBCC Microsoft VB .NET 3 13th Mar 2004 01:25 PM
Slice & Dice? Crash Gordon Microsoft Frontpage 10 2nd Mar 2004 04:58 PM
Dice VQF Player Tramp Freeware 0 23rd Jul 2003 02:32 PM


Features
 

Advertising
 

Newsgroups
 


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