+ Reply to Thread
Results 1 to 11 of 11

keep the cell the same unless it exceeds a predetermined number then change cell

  1. #1
    Registered User
    Join Date
    10-28-2015
    Location
    BFE, USA
    MS-Off Ver
    2010
    Posts
    30

    keep the cell the same unless it exceeds a predetermined number then change cell

    I hope this makes sense. This is a golf thing, Equitable Stroke Control. If your handicap is within a range, the current score can't exceed a certain amount. The scores need to be adjusted after the scores are entered before Gross total. I can't figure this out. I'm trying to use a case select but something isn't quite right.
    The highlighted green scores on the scores sheet are in question and need to be adjusted. I have a loop that would adjust and color according to the category. The CHcp changes several times a month.
    If your CHcp is:
    =<9 then max score is Par+2
    10-19 max 7
    20-29 max 8
    30-39 max 9
    40+ max 10
    Also, can you check my loop to see if there is a more efficient method for coding?
    Any assistance will be appreciated and thank you in advance for reviewing.
    Thanks
    Spyderwoman
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    This is to adjust each hole score according to the hcp, if needed and mark birdies.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    I don't know golf. From my understanding you basically whack a little white ball and it goes flying into the water, then you gotta go get it.

    However, I thought that you calculated the handicap at the end of the game. Not for each hole, and this code seems to alter the initial values. This doesn't seem right to me, but I don't know golf.

    Also, on the surface of your question I'm wondering why you can't just use a basic condition - i.e if score < maxscore then TotalScore=score else TotalScore=MaxScore? this would alter only the final score.

    If you do want to change the individual holes you probably do need the select case, but you still need to use the condition.

    Personally, I would never alter the start values - put them on a different sheet and run your code to create new values base on the update.

  4. #4
    Registered User
    Join Date
    10-28-2015
    Location
    BFE, USA
    MS-Off Ver
    2010
    Posts
    30

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    wow, how do you do this so fast. I'll check it out and let you know.
    thanks Jindon

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    Hi Spyderwoman,

    My best formula for ESC is:

    =MIN(D5,CHOOSE(($B5/10)+2,D$1+2,D$1+2,7,8,9,10))

    See my calculations in the attached.

    Equitable Stroke Control using Choose.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    Hey Journeyman,

    ESC is a defense against sandbaggers ..
    http://www.12stepgolf.com/Equitable-Stroke-Control.html
    Here are the rules...
    https://www.usga.org/HandicapFAQ/han...r.asp?FAQidx=9

    I think my Choose function below and in the attached does what the GHIN manual suggests. I think Jindon's VBA is overkill for the problem.

  7. #7
    Registered User
    Join Date
    10-28-2015
    Location
    BFE, USA
    MS-Off Ver
    2010
    Posts
    30

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    MarvinP, you're formula and layout is perfect. I couldn't figure some of Jindon out, but will use parts of it to format the birdies. Thanks to both of you. I'll mark this as solved and give you a A+ rating once I find it.
    thanks again

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    I think you can do birdies by using Conditional formatting.

    You can also do skins by finding the minimum score on each hole and then count how many of the scores are that minimum.

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    @ MarvinP

    I think Jindon's VBA is overkill for the problem.
    As the list keeps growing towards an entire year you'll have some serious calculations going on so VBA doesn't seem such a bad idea to me.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    I was just thinking that marking Birds (or better) could be done with Conditional Formatting and not needing to step into VBA. See the attached with CF for my example.

    Equitable Stroke CF Birds.xlsm

  11. #11
    Registered User
    Join Date
    10-28-2015
    Location
    BFE, USA
    MS-Off Ver
    2010
    Posts
    30

    Re: keep the cell the same unless it exceeds a predetermined number then change cell

    Marvin,
    Thanks for your help. I'm not sure if this was included in the workbook I uploaded but I use the vba loop for birdies so it will mark the player's name. I then filter by name so that I know who has a birdie without scanning the entire sheet, kind of like a report. I never have been good at the conditional formatting like your example, that is the main reason why I wrote it in a vba loop. Thanks again for your help and input. If you have other ideas, please feel free to pass along. Women's leagues are a pain in the ????.

+ 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] Autofilling a cell with a predetermined value based on dynamic value in another cell
    By borahda in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-21-2014, 05:54 AM
  2. Change cell value that exceeds other cell value
    By azgal in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-07-2014, 04:38 PM
  3. [SOLVED] Colour the first cell in a row/range cell where a value exceeds $x
    By DaveBre in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-06-2014, 01:45 AM
  4. Replies: 3
    Last Post: 12-17-2012, 11:16 PM
  5. copy cell value (here text) to a predetermined number of cells,
    By Amsterdam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-16-2012, 03:59 PM
  6. Replies: 0
    Last Post: 01-19-2012, 02:55 PM
  7. Keyboard shortcut pasting on a predetermined cell instead of a selected cell
    By blinkk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-27-2011, 03:37 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