Rapidly Enter Golf Scores Hole by Hole

KevCarter

Board Regular
Joined
Dec 7, 2013
Messages
161
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Good Morning All,

I’m looking for a solution to not have to use the tab key when entering golf scores on a form. Separate field for each hole. Scores are entered like:
4 4 5 5 4 10 4 5 ...

====================
If the score entered is greater than 1 Then
Go to the next field ‘ Post the tab key or go to field
Else
If there are 2 characters entered ‘ (like 10)
‘ Or perhaps the score entered is greater than 9
Go to the next field
End If
====================

This will allow the entry of double digit scores while rapidly moving along to the next field. When the seldom event of the player making a 1 happens, the user will have to use the tab key to move to the next field.

I’m pretty sure this can’t be accomplished on the worksheet itself, so I must use a form?

Any help in pointing me in the proper direction will be greatly appreciated!

Thank You,
Kevin
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
By Next field do you mean in column A
So all scores will be entered in Column A

In both situations you said go to next field

You sad:
I’m pretty sure this can’t be accomplished on the worksheet itself, so I must use a form?

No that's not true it can be done on a sheet<strike></strike>
 
Last edited:
Upvote 0
My Answer Is This,

I would LOVE to be able to do this on the worksheet itself!
The columns are set up like:

Name Hole 1 Hole 2 Hole 3 ...

So, on the worksheet, the formula, or VBA code would take me to the next column rather than the next form field.

Your guidance will be appreciated!
 
Upvote 0
So are you saying Name is column A
Hole 1 is Column B
Hole 2 is column C

So if you enter a value in column C you then want to jump to column D is that correct

So upon entering some value in a cell then always jump to the next cell to the right.

And how many columns would this effect?

Would it be column 1 to 19
18 holes per game
 
Upvote 0
I will assume the answers to my previous questions are "Yes"
Then try this:

If you enter any value in column 1 to 19 you will be immediately take to the next column. Now you will need to press the enter key or some arrow key
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Column > 0 And Target.Column < 19 Then: Target.Offset(0, 1).Select
End Sub
 
Last edited:
Upvote 0
My Answer Is This,

The code would not affect the first column (Name)

I would affect columns 2-10 (Holes 1-9) Skip column 11 (Front 9 Total which is protected)

Then again columns 12-20

All columns after 20 are computed and would not want these affected by the code to enter tab and move on. When the score is entered in column 20, we would move back to the next row column 2.
 
Upvote 0
Thank you! I'll give this a shot. I can work out the column numbers. I'll report back. I really appreciate the help! I thought the change event was only triggered when the value was accepted, not when typed. This will be great!
 
Upvote 0
Try what I sent you and see if it does what you want. Then I can adjust which columns if needed .
 
Upvote 0
Try this. Columns modified to your needs:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modiefied 3-10-18 12:19 PM EST
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Column > 1 And Target.Column < 11 Then: Target.Offset(0, 1).Select
If Target.Column > 11 And Target.Column < 21 Then: Target.Offset(0, 1).Select
End Sub
 
Upvote 0
I think for this to work on the worksheet, I would need something like the form event "KeyPress" ?

I believe the Worksheet_Change event is only going to fire when I either tab or enter, so I still need that second key press?
 
Upvote 0

Forum statistics

Threads
1,215,880
Messages
6,127,519
Members
449,385
Latest member
KMGLarson

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