Command Buttons on Userform

palaeontology

Active Member
Joined
May 12, 2017
Messages
444
Office Version
  1. 2016
Platform
  1. Windows
I have the following UserForm that I use in scoring a school Cross Country Carnival.

Touchpad Image.PNG


The command buttons that are important to this query are the 'Start' button which when pressed timestamps the start of the race, and the nine buttons in the centre, which when pressed timestamps when a runner from that House crosses the line.

Code for 'Start' button is ....
VBA Code:
Private Sub CommandButton11_Click()
Range("A1").Value = Now()
End Sub

Code for the 'Brad' (short for Bradman House) button is ...
Code:
Private Sub CommandButton1_Click()
Range("B65536").End(xlUp).Offset(1, 0) = "Bradman"
Range("B65536").End(xlUp).Offset(0, 1) = Now()
End Sub

The image below shows a snippet of the top few rows of data resulting from starting the race and students from various Houses crosing the line. You can see the codes (above) are sending their information to columns B and C.
scoresheet image.PNG


This userform has worked well for years now, however, the kids are getting lazy (uggh) and often coming across the line in big groups of different Houses, so pressing the corresponding House buttons has to be done quickly, but there is usually a small delay between when a button has been pressed and when another button is ready to recognise that it has also been pressed.

Consequently, I can be pressing the House buttons as quickly as I can see the students crossing the line, but the program can't always keep up, and in my haste to keep up with the number of students crossing the line, I don't always notice that some of my presses haven't been recognised.

Can anyone see a better way of recording this cross country race, allowing for rapid entry of big groups of kids from different Houses crossing the line at the same time ?

I was thinking of adding a number pad to the right of the existing House buttons (on the same UserForm). The idea would be that if a big group (consisting of 4 students from Gould, 6 students from Bradman, and 7 students from Sutherland) crossed the line at the same time, instead of pressing the Gould button 4 times, the Bradman button 6 times and the Sutherland button 7 times) I could press the Gould button once followed by pressing the 4 on the number pad, press the Bradman button once followed by pressing the 6 on the number pad and press the Sutherland button once followed by pressing the 7 on the number pad.

What I can't figure is how to change the existing code to have the spreadsheet understand to timestamp 4 Gould runners, 6 Bradman runners and 7 Sutherland runners one after the other.

I'll keep thinking on how to do this, but if someone can think of a better way to achieve this, can you please let me know.

Kind regards,

Chris
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
i'VE GONE A COMPLETELY DIFFERENT PATH TO SOLVE THIS PROBLEM, SO NO NEED TO ATTEMPT TO SOLVE THIS CURRENT PATH
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,816
Members
449,095
Latest member
m_smith_solihull

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