Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Creates a random array of integers 1 to 52 (for a deck of cards)
- Sub shuffleTheDeckArray()
- Dim bigNumberArray(51) As Double, cardDeck(51) As Long, i As Long
- For i = 0 To 51
- bigNumberArray(i) = Application.WorksheetFunction.RandBetween(0, 9999999999999#)
- Next i
- For i = 0 To 51
- cardDeck(i) = Application.WorksheetFunction.Match(Application.WorksheetFunction.Large(bigNumberArray, 1 + i), bigNumberArray, 0)
- Debug.Print cardDeck(i)
- Next i
- Erase bigNumberArray 'no longer needed, erased for memory
- End Sub
Add Comment
Please, Sign In to add comment