+ Reply to Thread
Results 1 to 23 of 23

Help with marco for darts sheet

  1. #1
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Help with marco for darts sheet

    Hello all,

    New to the forum and a beginner with VBA.

    I have a spreadsheet that I use to help some friends and I with keeping score in a darts game. I have it set up to automatically keep track of any scores of a certain value. If you play darts or watch it on TV, you know they track scores over 100 called 'Tons'. They will also track if you hit a 120, 140 or 180. I have my spreadsheet arranged to count these scores, as well as the number of games played to a certain point. I have a button to reset the entire sheet and another to reset just the score input area. When I reset the score input area, it will also reset the 100/120/140/180 counts. I'd like these values to continue being added until the button to reset the entire sheet is pressed.

    Any help that could be provided would be appreciated. The code is as follows:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Help with marco for darts sheet

    Welcome to the board!
    I'd like these values to continue being added until the button to reset the entire sheet is pressed.
    Please Login or Register  to view this content.
    FWIW, when you declare multiple variable on one line, you'd think they would all be integers, but the first three are actually Variants with the last being a Integer.

    So you'd have to

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Help with marco for darts sheet

    What's the code attached to the buttons?

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Help with marco for darts sheet

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    Quote Originally Posted by StephenR View Post
    What's the code attached to the buttons?
    To reset just the score entry area, and to add 'legs' and 'sets' for a match is:
    Please Login or Register  to view this content.
    To reset the full sheet:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    Quote Originally Posted by Tinbendr View Post
    Welcome to the board!

    Please Login or Register  to view this content.
    I've actually tried this, but as I'm imputting scores it will add more than 1 to D8. For example, i'll input 100 in the O column and 1 will show in D8. When I input another 100, the cell D8 will show up as 3 instead of 2 as there is now have a 1 in the value D8 and the value of 'a' will be 2.

  7. #7
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    Note: I also have this 'Private Sub' running in the sheet script. I'm wondering if this is the cause due to the "Is Nothing" or "IsEmpty" statements...

    Please Login or Register  to view this content.

  8. #8
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Help with marco for darts sheet

    the cell D8 will show up as 3 instead of 2...
    Sounds like the event is double firing. You'll have to setup some breakpoints and variable watches to see what's going on.

  9. #9
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    I have no idea how to do any of that.

  10. #10
    Forum Contributor
    Join Date
    01-25-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    434

    Re: Help with marco for darts sheet

    are you forwarding results to a master database, or is the app intended to be just used during a single match, all entries forgotten afterwards ?

  11. #11
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Help with marco for darts sheet

    Just stepping back to the original question...

    Please Login or Register  to view this content.
    But you could use the CountIf functions as formulas in the worksheet so they update automatically...
    Last edited by cytop; 01-26-2014 at 04:16 AM.

  12. #12
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    Here's what I have/want/need. Don't know if this will help or not for a visual.

    In the picture below, you input the scores into column O like in the box marked "1". The scores that are kept track of show up in box "2". To do this is the code I posted originally called 'TonPlus1' that is automatically done using the 'Private Sub Worksheet_Change' code I also posted later. When I push the button marked "4", I clear the O column in box "1" (and the Q column) and add a leg to the cell next to button "4" and that code is the 'Winner1' code I posted. When that happens and you start inputting new scores in the O column, the totals in box "2" reset, which is what I don't want to happen until you press the button marked "3". The button "3" would clear the scores in column O and Q, the Legs and Sets, and the totals in box "2" as shown in the 'Clear Game' code I posted.

    So again, I'm trying to set it up to continuously count the scores in box "2" until button "3" is pressed but not when button "4" is pressed. I'm wondering if it's because of the 'Private Sub Worksheet_Change' code?
    Attached Images Attached Images

  13. #13
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Help with marco for darts sheet

    Hi DJRyan25

  14. #14
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Help with marco for darts sheet

    Hi DJRyan25,

    sounds like it is time to actually load a copy of your spreadsheet so we can actually see what it is doing and then work out how to fulfill you original request

    Jmac

  15. #15
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    The file was too large to upload here, so I used WeTransfer to e-mail it to myself. See link below. Download good until Feb. 3rd.

    Electronic Darts Scoreboard

  16. #16
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    Hi again,

    Not sure if anyone had a chance to download/look at the spreadsheet I posted, but if not I've taken just a couple of sheets out as a sample and put them into a new sheet which I have attached here. Anyone can feel free to download and use/edit it to their liking.

    If anyone can get my problem solved, I'd appreciate it if you could also let me know what you did so I can fix my full sheet.
    Attached Files Attached Files
    Last edited by DJRyan25; 02-19-2014 at 12:33 PM. Reason: Need new attachment

  17. #17
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    Hey guys,

    please disregard the attachment on my last post. It was missing a tab. See new attachment here.

    Sample Darts Sheet 2014_02_19.xls

  18. #18
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    Anybody? Anybody?

    Bueller? Bueller?

  19. #19
    Forum Contributor
    Join Date
    01-25-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    434

    Re: Help with marco for darts sheet

    You need to set some values to the variables you're using, see the changes in the code below

    Player 1
    Please Login or Register  to view this content.
    Player 2
    Please Login or Register  to view this content.

  20. #20
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    ThirtyTwo,

    That does help with not "resetting" the values when I start a new leg, but it's still 'double firing' like a previous code offered by Tinbendr. Also, if I input a value that is less than 100 after a value that is greater than 100, it will add to to the values that are there.

  21. #21
    Forum Contributor
    Join Date
    01-25-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    434

    Re: Help with marco for darts sheet

    Quote Originally Posted by DJRyan25 View Post
    ThirtyTwo,

    That does help with not "resetting" the values when I start a new leg, but it's still 'double firing' like a previous code offered by Tinbendr. Also, if I input a value that is less than 100 after a value that is greater than 100, it will add to to the values that are there.
    Sorry for the delay in replying

    Changes I've made

    Delete Macros :- Worksheet_Change, TonPlus1, TonPlus2

    Add this line to NEW501_1v1

    Please Login or Register  to view this content.
    Create new macro: - TonPlus

    Please Login or Register  to view this content.
    It's a modification on what you had, as in it's checking for new values that are entered

    It checks for new entries to the 501 sheet

    If data entry is in column 15 (O) then it checks what the value is and increases the relevant total by 1 for Player 1
    If data entry is in column 17 (Q) then it checks what the value is and increases the relevant total by 1 for Player 2
    Last edited by ThirtyTwo; 03-09-2014 at 02:07 PM. Reason: missed a [/code]

  22. #22
    Registered User
    Join Date
    01-23-2014
    Location
    Newfoundland
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Help with marco for darts sheet

    ThirtyTwo,

    That works ideally. I greatly appreciate the help. If I lived closer, I'd buy you a few drinks at a local pub! Since Paddy's Day is coming up... Slàinte!

  23. #23
    Forum Contributor
    Join Date
    01-25-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    434

    Re: Help with marco for darts sheet

    I'm pleased we got there in the end

    But as you've said, we live to apart for you to buy me a pint, so the best think you can do for me is click - * Add Reputation

    btw - I also gave some thought to lazy score keepers, give them the option to enter per dart score, rather than the total of three. This would also give benefits of recalculating new outs as each dart is thrown

+ 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. Replies: 0
    Last Post: 09-10-2013, 08:17 AM
  2. looking for marco to pull information from different sheet
    By zbyke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2013, 02:33 AM
  3. Darts Scorebaord
    By gallen6945 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2013, 08:50 AM
  4. Marco for to go to next sheet
    By SURESH G in forum Excel General
    Replies: 7
    Last Post: 03-07-2012, 04:31 AM
  5. Help With Sheet Compare Marco I Trying To Use
    By gaspower in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2008, 12:50 PM

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