VBA Magic Card Trick VBA Card Trick.xlsm
As a kid, I learned this magic card trick using a physical deck of cards. It is your typical "pick a card, any card" trick. There is no slight-of-hand, but there are a couple of tricks that make it work. This article will show you the trick, how it is performed, and how it was implemented in Excel.
The Trick
The trick is performed using 21 random cards dealt face up in 3 columns of 7 cards each. Like this:
7C JS 2D
5S 2S 7S
KS QC 4H
3D 5D JD
4S 8S 6S
8D 9S 3H
7D 2H 10D
Ask your volunteer to "pick a card, any card but don't tell me what it is." Once they select a card, ask them what column contains that card. They answer "left", "middle" or "right". Or they could answer "first", "second" or "third". Or even just point to the column.
You pick up the cards, deal them out again, and ask for the column that contains that same card. The volunteer let?s you know the column. You pick up the card and deal them out again. Ask your volunteer a third time what column the card is in.
Once they select the column, you now know the exact card they chose, and you perform your reveal. The reveal can be just telling them their card, or picking up the cards and discarding them until only their card remains, or many other flashy techniques to tell them their chosen card. They are amazed.
The Secret
Your volunteer probably assumes you memorized all the cards and where they are located. But that is definitely not the case. The secret is how you deal the cards and how they are picked up.
Dealing
The cards always remain face up. Do not turn them over. Always deal the cards across, left to right. Then to the next row down. Like this:
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
19 20 21
Pick up
Whatever column your volunteer says their card is located in, that column must be picked up 2nd. For example, if the card is in the right column, pickup left column first, then the right column and finally the center column. It does not matter which column is picked up first or last, only the column with the card must be picked up 2nd.
Also, the column should be picked up so the top of the column ends up at the bottom of that stack. What does that mean? If the volunteer says their card is in the center column. Slide the cards in the left column down towards you so 19 ends up on top and 1 ends up on the bottom. Place that stack on the 20 card and slide them towards you so the 2 card ends up at the bottom of the combined stack. Place that stack on the 21 card and slide them down so the 3 card ends up on the bottom the entire stack. The top card will be the 19, the bottom card will be the 3.
The Answer
1) You deal once. The card is selected. The column is pointed out
2) You pick up the cards
3) You deal again.
4) The column is pointed out
5) You pick up the cards
6) You deal again.
7) The column is pointed out.
The card that was selected always ends up as the 4th card down. Once the column is pointed out that third time, you know the exact card they chose. Let?s say after step 6 the cards look like this
2S AD 9D
4C 4S AS
5D 3C KC
10S 6H 5H
QD 7S 7C
2C 10D JD
AC 9S 4H
You know their card is either 10S, 6H or 5H. When they tell you the column in step 7, you know the exact card they selected.
Excel
There are 4 buttons placed on the worksheet. The first is a Shuffle button that mixes up the cards. It really is not necessary but it adds a little more randomness to the trick.
The other 3 buttons allow the selection of the column the card is in. The code for each button just identifies the column and passes that info to the pickup and deal routine. Here is the example of the ?2 Button.?
The pickup and deal routine sets up which column is picked up first, second and third
There is an array to hold the card while picking them up and dealing them out. Whatever column is picked up first goes in the array as cards(0) to cards(6). The second column, the one with the volunteer?s card, goes in cards(7) to cards(13). And the final column goes in cards(14) to cards(20).
The cards are dealt in the order described above. Across from left to right, then down the next row.
After the third deal and the column is selected, the winning card will always be in cards(10).
There is also 2 conditional formats for the playing area and the column with all cards. Both format check for D or H and color the font red.
Bookmarks