View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default In excel, I want to generate a random number

Rick, that's pretty slick.

Thanks!

I'll bet you could make it even slicker by modifying this portion:

TempDeck(X) = TempDeck(X) & " of "
If (X - 1) \ 13 = 0 Then
TempDeck(X) = TempDeck(X) & "Spades"
ElseIf (X - 1) \ 13 = 1 Then
TempDeck(X) = TempDeck(X) & "Hearts"
ElseIf (X - 1) \ 13 = 2 Then
TempDeck(X) = TempDeck(X) & "Diamonds"
ElseIf (X - 1) \ 13 = 3 Then
TempDeck(X) = TempDeck(X) & "Clubs"

So that instead of returning the string name Spades, Hearts,
Diamonds, Clubs, it returns the red or black colored symbol.


That might be somewhat difficult to do... not the coding, that is easy...
rather, where to display it at. The card suit symbols exist in the Symbol
font, as do the ten digits, but the letters (AJQK) do not. I am newly
returned to Excel after a long absence, so I may have forgotten... it there
a display object in the VBA world that can take mixed fonts like the Form or
PictureBox objects in the compiled versions of VB?

Rick