Working using excel macros

  • Hello,


    I am attempting to run a macro on probability.


    In a party there are some people who will shake their hands(men with women).

    In sheet one I'll enter all their names and there will be two buttons "If there are more men than women" and "If there are more women than men".


    When I click on "If there are more men than women" button, it should display as below:

    In sheet two :

    Man 1 shakes hand with woman 1

    Man 2 shakes hand with woman 2

    Man 3 shakes hand with no one.


    In sheet three :

    Man 1 shakes hand with woman 2

    Man 2 shakes hand with no one

    Man 3 shakes hand with woman 1


    In sheet four :

    Man 1 shakes hand with no one

    Man 2 shakes hand with woman 1

    Man 3 shakes hand with woman 2


    And the cycle goes(if number of men and women is more).


    When I click on "If there are more women than men" button, it should display as below:

    In sheet two :

    Woman 1 shakes hand with man 1

    Woman 2 shakes hand with man 2

    Woman 3 shakes hand with no one.


    In sheet three :

    Woman 1 shakes hand with man 2

    Woman 2 shakes hand with no one

    Woman 3 shakes hand with man 1


    In sheet four :

    Woman 1 shakes hand with no one

    Woman 2 shakes hand with man 1

    Woman 3 shakes hand with 2.


    And the cycle goes(if number of men and women is more).


    Please help me to solve this!!