Keep W-L of card game played over time

Preacherman771

New Member
Joined
Jun 15, 2021
Messages
46
Office Version
  1. 365
Platform
  1. Windows
I have created a score worksheet for Hand & Foot Canasta for when my wife and I play. As we enter points for each hand it will keep track of total points, stating who is winning at the time by how many points. Once a player reaches a score greater than 10,000 total points, it will declare game over and the winner by how many points. I have also created a macro (Ctr-Q) which clears the worksheet of all points to start a fresh game once a winner is declared. What I would like to do now is somehow to keep a w-l tally for each player based on the result of the game. Normally I would create in the w-l cell under each player's name an if statement based on who won and who lost. What I am wanting to know is if since I use the clear macro I created after each game and then saving the cleared file, would there be a way of tallying who won and lost, use the clear macro but still have the players w-l record to date available next time the file is opened? e.g., Game 1: Player 1 is 1-0 and Player 2 is 0-1. When file is opened it would show that record and then add the result of Game 2, which player 1 lost and player 2 won thus the new records would be Player 1: 1-1 & Player 2: 1-1, before clearing the board and saving it.
Hand & foot score sheet.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1HAND & FOOT SCORE SHEET
2Team 1:PamPamRoyPam Won the Game by 405 Points
3Team 2:Roy1205511650
4
5RECORD
6PamRoy Deal      
7WLWLPamPamPamPam    
81001Points to Start:50120120GAME OVER    
91st Finishy100 y100     
10Red Books:210002100031500     
11Black Books:3900260041200     
12Wild Card Books:y1500 y1500     
13Hand Points:850850955
14Total Points435024505255     
15*Dealt 1st Deal     
16RoyRoyRoyRoyRoyRoyRoyRoy
1750120120GAME OVER    
181st Finish y100      
19Red Books:21000315001500     
20Black Books:260026002600     
21Wild Card Books:y1500y1500y1500     
22Hand Points:755845650
23Total Points:385545453250     
Sheet1
Cell Formulas
RangeFormula
Q2Q2=IF(AND(J3<10000,M3<10000), (IF(J3>M3,J2&" Is Winning by "&J3-M3&" Points",M2&" Is Winning by "&M3-J3&" Points")), IF(AND(J3>=10000,J3>M3),J2&" Won the Game by "&J3-M3&" Points", IF(M3>=10000,M2&" Won the Game by "&M3-J3&" Points","")))
J2J2=J7
J3J3=SUM(J14:AF14)
M2M2=J16
M3M3=SUM(J23:AF23)
B6,E6B6=J2
K6,K15K6=IF(J6="*","Dealt 1st","")
B8B8=IF(AND(J3<10000,M3<10000),"", IF(OR(J3>=10000,M3>=10000), IF(J3>M3,1,0)))
C8C8=IF(AND(J3<10000,M3<10000),"", IF(OR(J3>=10000,M3>=10000), IF(J3<M3,1,0)))
E8E8=IF(AND(J3<10000,M3<10000),"", IF(OR(J3>=10000,M3>=10000), IF(M3>J3,1,0)))
F8F8=IF(AND(J3<10000,M3<10000),"", IF(OR(J3>=10000,M3>=10000), IF(M3<J3,1,0)))
M6,AE15,AB15,Y15,V15,S15,P15,M15,AE6,AB6,Y6,V6,S6,P6M6=IF(OR(J14="",M8="GAME OVER"),"", IF(J6="","Deal",""))
M7,AE7,AB7,Y7,V7,S7,P7M7=IF(OR(J8="GAME OVER",J7=""),"",$J$7)
M8,AE8,AB8,Y8,V8,S8,P8M8=IF(OR(COUNTIF($J8:L8,"*"&"Over"&"*")=1,COUNTIF($J17:L17,"*"&"Over"&"*")=1),"", IF(SUM($J23:L23)>=10000,"GAME OVER", IF(SUM($J14:L14)>=10000,"GAME OVER", IF(J14="","", IF($J$3<=2999,50, IF(AND($J$3>3000,$J$3<=6499),90,120))))))
K9,AF18,AC18,Z18,W18,T18,Q18,N18,K18,AF9,AC9,Z9,W9,T9,Q9,N9K9=IF(J9="Y",100,"")
K10,AF19,AC19,Z19,W19,T19,Q19,N19,K19,AF10,AC10,Z10,W10,T10,Q10,N10K10=IF(J10="","",SUM(J10*500))
K11,AF20,AC20,Z20,W20,T20,Q20,N20,K20,AF11,AC11,Z11,W11,T11,Q11,N11K11=IF(J11="","",SUM(J11*300))
K12,AF21,AC21,Z21,W21,T21,Q21,N21,K21,AF12,AC12,Z12,W12,T12,Q12,N12K12=IF(J12="","",IF(J12="Y",1500,-1500))
J14,AE23,AB23,Y23,V23,S23,P23,M23,J23,AE14,AB14,Y14,V14,S14,P14,M14J14=IF(SUM(K9:K13)=0,"",SUM(K9:K13))
M16,AE16,AB16,Y16,V16,S16,P16M16=$J$16
M17,AE17,AB17,Y17,V17,S17,P17M17=IF(OR(COUNTIF($J17:L17,"*"&"Over"&"*")=1,COUNTIF($J8:L8,"*"&"Over"&"*")=1),"", IF(SUM($J23:L23)>=10000,"GAME OVER", IF(SUM($J14:L14)>=10000,"GAME OVER", IF(J23="","", IF($J$3<=2999,50, IF(AND($J$3>3000,$J$3<=6499),90,120))))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M9:N13,P9:Q13,S9:T13,V9:W13,Y9:Z13,AB9:AC13,AE9:AF13,M18:N18,P18:Q22,S18:T22,V18:W22,Y18:Z22,AB18:AC22,AE18:AF22,M19:M21,M22:N22Expression=OR($M$8="GAME OVER",$M$17="GAME OVER")textNO
P9:Q13,S9:T13,V9:W13,Y9:Z13,AB9:AC13,AE9:AF13,P18:Q22,S18:T22,V18:W22,Y18:Z22,AB18:AC22,AE18:AF22Expression=OR($P$8="GAME OVER",$P$17="GAME OVER")textNO
S9:T13,V9:W13,Y9:Z13,AB9:AC13,AE9:AF13,S18:T22,V18:W22,Y18:Z22,AB18:AC22,AE18:AF22Expression=OR($S$8="GAME OVER",$S$17="GAME OVER")textNO
V9:W13,Y9:Z13,AB9:AC13,AE9:AF13,V18:W22,Y18:Z22,AB18:AC22,AE18:AF22Expression=OR($V$8="GAME OVER",$V$17="GAME OVER")textNO
Y9:Z13,AB9:AC13,AE9:AF13,Y18:Z22,AB18:AC22,AE18:AF22Expression=OR($Y$8="GAME OVER",$Y$17="GAME OVER")textNO
AB9:AC13,AE9:AF13,AB18:AC22,AE18:AF22Expression=OR($AB$8="GAME OVER",$AB$17="GAME OVER")textNO
AE9:AF13,AE18:AF22Expression=OR($AE$8="GAME OVER",$AE$17="GAME OVER")textNO
J8:AF8,J17:AF17Cell Valuecontains "GAME OVER"textNO
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Sounds like you could add a short IF...THEN...ELSE statement before your clearing query, like

VBA Code:
If Range("J3").Value2 > Range("M3").Value2 Then
    Range("B8").Value2 = Range("B8").Value2 + 1
    Range("F8").Value2 = Range("F8").Value2 + 1
Else
    Range("C8").Value2 = Range("C8").Value2 + 1
    Range("E8").Value2 = Range("E8").Value2 + 1
End If
 
Upvote 0
Thank you for your assistance. I entered the VBA code you suggested however when I hit F-5 (run) I continually receive "Compile error: Invalid outside procedure" and within the code the ("J3") entry portion highlighted.
 
Upvote 0
Did you put it into a subroutine like below?

VBA Code:
Sub TallyPoints()
If Range("J3").Value2 > Range("M3").Value2 Then
    Range("B8").Value2 = Range("B8").Value2 + 1
    Range("F8").Value2 = Range("F8").Value2 + 1
Else
    Range("C8").Value2 = Range("C8").Value2 + 1
    Range("E8").Value2 = Range("E8").Value2 + 1
End If
End Sub
 
Upvote 0
Solution
Well, in that case, thanks to both of you. My wife & I will greatly enjoy being able to keep track of "bragging rights". ;)
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top