+ Reply to Thread
Results 1 to 27 of 27

Tennis scoring macro

Hybrid View

davidofyfea Tennis scoring macro 05-10-2017, 09:01 AM
leelnich Re: Tennis scoring macro 05-10-2017, 09:20 AM
davidofyfea Re: Tennis scoring macro 05-10-2017, 09:50 AM
leelnich Re: Tennis scoring macro 05-10-2017, 10:39 AM
kev_ Re: Tennis scoring macro 05-10-2017, 12:17 PM
davidofyfea Re: Tennis scoring macro 05-10-2017, 10:19 PM
kev_ Re: Tennis scoring macro 05-11-2017, 09:30 AM
davidofyfea Re: Tennis scoring macro 05-11-2017, 11:01 AM
kev_ Re: Tennis scoring macro 05-11-2017, 12:02 PM
kev_ Re: Tennis scoring macro 05-12-2017, 04:04 AM
davidofyfea Re: Tennis scoring macro 05-12-2017, 04:56 AM
kev_ Re: Tennis scoring macro 05-12-2017, 05:24 AM
kev_ Re: Tennis scoring macro 05-12-2017, 07:35 AM
davidofyfea Re: Tennis scoring macro 05-12-2017, 08:57 AM
kev_ Re: Tennis scoring macro 05-15-2017, 12:25 PM
kev_ Re: Tennis scoring macro 05-16-2017, 11:10 AM
davidofyfea Re: Tennis scoring macro 05-16-2017, 10:44 PM
kev_ Re: Tennis scoring macro 05-18-2017, 11:39 AM
davidofyfea Re: Tennis scoring macro 05-18-2017, 11:46 AM
kev_ Re: Tennis scoring macro 05-18-2017, 11:57 AM
davidofyfea Re: Tennis scoring macro 05-18-2017, 12:26 PM
kev_ Re: Tennis scoring macro 05-18-2017, 05:08 PM
kev_ Re: Tennis scoring macro 05-19-2017, 01:14 AM
davidofyfea Re: Tennis scoring macro 05-19-2017, 03:55 AM
kev_ Re: Tennis scoring macro 05-19-2017, 04:15 AM
mikejordan Re: Tennis scoring macro 01-11-2021, 08:00 AM
wasaro5534 Re: Tennis scoring macro 01-27-2023, 05:27 AM
  1. #1
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Tennis scoring macro

    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
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  2. #2
    Registered User
    Join Date
    05-10-2017
    Location
    Philippines
    MS-Off Ver
    2021
    Posts
    35

    Re: Tennis scoring macro

    Thanks - no hurry

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] tennis game
    By BeddisC in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-21-2016, 07:56 AM
  2. Simulating a tennis game
    By PaulStoryBro in forum Excel General
    Replies: 5
    Last Post: 03-19-2014, 12:18 AM
  3. [SOLVED] Scoring responses by macro
    By spiwere in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-19-2013, 10:01 AM
  4. Tennis Ranking
    By clundeen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2011, 10:47 AM
  5. Scoring Macro
    By jkarthi22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2008, 05:33 AM
  6. Tennis set combinations
    By Raigmore in forum Excel General
    Replies: 15
    Last Post: 01-04-2006, 10:15 AM
  7. [SOLVED] I need a template for scoring tennis matches
    By Jack in forum Excel General
    Replies: 0
    Last Post: 10-06-2005, 08:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1