ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A 2 fold macro question. *(I need some MVP help on this one.) (https://www.excelbanter.com/excel-programming/285068-re-2-fold-macro-question-%2A-i-need-some-mvp-help-one.html)

J.E. McGimpsey

A 2 fold macro question. *(I need some MVP help on this one.)
 
1)
Dim nPlayers As Variant
Dim nPlayer As Long
Dim nRounds As Long
Dim nTurns As Long

Do
nPlayers = Application.InputBox( _
Prompt:="How many players (1 to 4)?", _
Default:=4, _
Type:=1)
If nPlayers = Cancel Then Exit Sub 'clicked Cancel
Loop Until nPlayers 0 And nPlayers <= 4
For nRounds = 1 to 13
For nTurns = 1 to 3
For nPlayer = 1 to nPlayers
MsgBox "Now up: Player " & nPlayer
'Do stuff
'end player's turn
Next nPlayer
Next nTurns
Next nRounds


2) I would probably use a Userform for this, that displays the
results of the roll, along with option buttons for where to store
the results of a roll.

In article ,
"Pete" wrote:

1) My first dilemma is I do not know how to make the
spreadsheet recognize whose turn it is. I need something
that says after a Player 1 has recorded his/her score
clear dice and announce it is Players 2 turn and so on.
But if there are only 2 Players then after Player 2
records there score then it is Players 1 turn again. And
so on for any combination of the number of players that
are in the game.

2) My second dilemma is when the Player is happy with
there dice then I want to be able to give them the ability
to Record there score in the appropriate box they see fit.
What I in vision is a button that is linked to a macro
that looks at the outcome of the dice and which players
turn it is and populates the outcome or total of the dice
in the proper box. Keep in mind the outcome of the dice
could be anything from a Full house (6-6-6-5-5), to random
numbers of anything (1-3-5-2-2) and you have to choose
whether to take the total score of the dice ("Chance") or
put 1 in the ("1's box) or 4 in the (2's box).



All times are GMT +1. The time now is 02:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com