The easiest way to log the scores is to use a change event macro to trigger when changes are made to the scores on the worksheet
Using the file I posted (as amended by you):
- add this code to the VBA module of the sheet containing the scores (must place in the SHEET module)
- add a new worksheet and name it "LogScores" - everything will be listed there
- there are a few duplicate triggers - need to amend userform VBA to sort that - needs some careful thinking - will revisit tomorrow.
Every time the score is changed, the log is also updated
Some values wrapped in CInt() to convert textbox values to numbers to make suppression of zeros easily - will avoid this being necessary when I amend the userform code later
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet: Set ws = Sheets("LogScores")
If Not Intersect(Target, Range("D3")) Is Nothing Then
r = ws.Range("A" & Cells.Rows.Count).End(xlUp).Row + 1
With ws.Cells(r, 1)
On Error Resume Next
.Offset(, 0).Value = CInt(Range("D2"))
.Offset(, 1).Value = CInt(Range("D3"))
.Offset(, 2).Value = CInt(Range("C2"))
.Offset(, 3).Value = CInt(Range("C3"))
.Offset(, 4).Value = CInt(Range("B2"))
.Offset(, 5).Value = CInt(Range("B3"))
On Error GoTo 0
End With
ws.Cells(r, 3).Resize(, 4).NumberFormat = "0;;;@"
ws.Cells(r, 3).Resize(, 6).HorizontalAlignment = xlCenter
End If
End Sub
Either tomorrow, or more likely Sunday, I will post file with amended VBA
Bookmarks