# VBForums CodeBank > Codebank - Game Programming >  MS Excel - Cards - Texas Hold'em

## dbasnett

This came about because of this thread http://www.vbforums.com/showthread.php?t=501535.

What I came up with is a four-handed Texas Hold'em game that is done in Excel.  I became interested in shuffling randomness, card distribution, detecting winning hands.  The Auto & Fast checkboxes allowed me to check distributions for large number of hands.

BTW - it doesn't actually have non-computer players.

Attachment 69795

----------


## Hack

_Moved_

----------


## balasivi

Attachment not able to download. i am very much eager to see the code. Can you please send me to _Removed By Mod_

Please send to my email id this is my humble request i am so interested to see the code because i am trying this code for past 4 days but i am not getting logic. 

Thanks
Bala

----------


## Hack

Welcome to the forums.   :wave: 

I have edited your post and removed your email address.

You should never post your email address in an open post on an open forum.   Mail spam bots can pick that up and before you know it, your mailbox is full of junk mail.   If you wish to share your email address with other forum members, please do so via our PM system.

Thanks.   :Smilie: 

Now that we have that out of the way, lets talk about this.


> Attachment not able to download.


I'll see what I can do about getting that link fixed.

----------


## Hack

balasivi:   Try downloading the attachment now.

----------


## balasivi

sorry here after i will not post my email id in forum's. Thanks for your info and fast reply. Now i am able to download the file. Really thanks a lot for your help. 

Do you have an Texas Hold Em Odds Calculator in Excel.  if you have please share it with me.

Thanks
Bala

----------


## Hack

Although we do allow a good deal of latitude with respect to questions in the CodeBank if they pertain specifically to the CodeBank entry, as a rule, this section is just for members to share their code with other members.

As such, I've copied your last post and created a new thread for you in the Office Development Q&A section.

You can find it here.   http://www.vbforums.com/showthread.php?t=562064  :Smilie:

----------


## quazzy

> This came about because of this thread http://www.vbforums.com/showthread.php?t=501535.
> 
> What I came up with is a four-handed Texas Hold'em game that is done in Excel.  I became interested in shuffling randomness, card distribution, detecting winning hands.  The Auto & Fast checkboxes allowed me to check distributions for large number of hands.
> 
> BTW - it doesn't actually have non-computer players.
> 
> Attachment 69795


Hi. I am desperately trying to work out something similar using tables on sheets and multiple lookups and if statements. I think this is a hopeless task!. Do you still have your excel VBA solution, and would you be kind enough to make it available to me, as the old thread seems to have lost its attachment? I am a newbie to vbforums and am not sure if I have posted this request correctly, or how to download your solution - if you still have it!

Many Thanks. Quazzy.

----------


## mhlester

In 2006, for fun, I created a simple two-player Texas Holdem game spreadsheet with just a few simple macros and no VB. Recently, I added odds of winning before the flop and eight additional players. Now, I want to add betting, bluffing, and folding for the nine computer hands through the showdown.

I am not a programmer. I don't know VB. But I hope to do this all with formulas.

I'd love to share ideas.
Michael

----------


## quazzy

Hi, I am trying to do something similar. I would love it if you would be prepared to post what you have already. I have some VB, and some ideas on ranking the hands, but at the moment I am trying to do without VB, and sorting and re-sorting each hand and its comparative rank as each stage of the hand unfold.

So, "Hand 1" gets dealt two suited unpaired cards from 10, J, Q, K and A, giving it a chance of a Royal Flush, as long as there are no other hands with any of the same suited cards in that range, so I will mark a cells nearby as "possible", the cards needed, and the probability based on cards left in the deck.

For each hand I will display the best possible hands at pre-flop, flop, turn and river stages, the cards needed, and the prob of them turning up. 

I am concentrating on four hands and a 'hole' (community cards) so that I can cover splits between any of the four hands, but also the four-way split that would occur if the 'hole' produced the best result. I am using tables of 4 * 13 cards to show what cards are available/left at each stage and then re-calculate what each hands needs to get into a winning/splitting position. I am also building lookup tables for the various hands e.g. Royal Flush, Straight Flush, 4 of a kind, Full House, Flush etc. all the way down to a High card.

I realise there are millions of possibilities at the outset, and it is impractical to enter them all in, so I may concentrate on looking at sequences such as open-ended straights, gut-shot straights, threes, two pairs and so on first, and then consider the suits (or the other way round - who knows!)

Anyway, I am tinkering away, and many heads may come up with many ideas and approaches. Adding pictures in place of AC or 1C or 13C (all representing Ace of Clubs) can follow once the calculations are done.

Once, again would love to see what you have managed with two hands and no VB, and would be prepared to swap/share what I have so far.

I look forward to further discussions, if you are up for it.

Best Regards. Quazzy.

----------

