Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mrbrently
 
Posts: n/a
Default Record hh:mm:ss on click of cell

I'm a school sports coordinator and trying to set up an XL spreadsheet to
record the Triathlon and Cross Country finishers. Hit a button for time on
the laptop as they cross the line and put down their number. A quick filter
when all the competitors are in and strait into prize giving. Wouldn't that
be fantastic.
Would you know how to do this?

If you use ctrl+shift+: you only get hours and minutes. I need seconds.
I tried using =now() and a macro. Couldn't get the required result.
Any ideas?
--
Cheers!
Mrbrently
  #2   Report Post  
arno
 
Posts: n/a
Default

Hi Mrbrently,

I tried using =now() and a macro. Couldn't get the required result.
Any ideas?


sure, try

Sub Makro1()
Range("a1").NumberFormat = "dd/mm/yyyy hh:mm:ss"
Range("a1").Value = Now
End Sub

I think you just have the wrong number format in your sheet, add the
seconds :ss to your format.

regards

arno


  #3   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

Create an Excel workbook.
On some sheet, enter:

A1="StartTime:"
A2="Nr"
B2="ID" (or "Name")
C2="Time"
F1="NextNr:"

Format cell C1 as "h:mm:ss"
Format cells C3:C4## as "mm:ss", where ## is any number 3, you think as
resonable.
For cell G1, use data validation: allow whole numbers only between 1 and ##,
where ## is any number 1, you think as reasonable.

Create 2 named ranges:
StartTime=Sheet1!$C$1
NextNr=Sheet1!$G$1

Activate VBA editor (Alt+F11). Insert a module. Insert 2 procedures into
this module

Public Sub InsertStartTime()
Range("C1").Value = Time
End Sub

Public Sub InsertFinishTime()
Nr = IIf([NextNr] = "", 1, [NextNr])
Range("A2").Offset(Nr, 0).Value = Nr
Range("A2").Offset(Nr, 2).Value = Time - [StartTime]
Range("G1").Value = IIf(Nr = "", 1, Nr) + 1
End Sub

From View menu, activate Forms toolbar.
Insert a button (p.e. over cells D1:E1), link it to procedure
InsertStartTime, and rename the button text to "Start the clock"
Insert a button (p.e. over cells D2:E2), link it to procedure
InsertFinshTime, and rename the button text to "Register finish time"

The sheet is ready for use. Before to use it, enter the order number of
finisher, you want to start to register times for (p.e. 1) into cell G1,
and clear all data from range A3:C## (finish order numbers and finishing
times), when there were some.
To register the start time, click on button "Start the clock". The start
time is inserted into cell C1.
When first runner finishes, click on button "Register finish time". The
order number (1) is inserted into cell A3, and end time (=system time-start
time) is inserted into cell C3. Ito cell B3 you can enter competitors number
or name, when you have enough time for it. And the value of NextNr in cell
G1 is increased by one. The sheet is ready for next competitor.
When second runner finishes, click on button "Register finish time" again.
And so on.

I didn't find any possibiolity to register times in VBA with decimals of
second. Although it is possible using NOW() function in cell (you have to
use custom cell format to see it), but it seems VBA doesn't support the use
of NOW() with Application.WorksheetFunction, so I didn't find a way to
register the time more exactly.

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Mrbrently" wrote in message
...
I'm a school sports coordinator and trying to set up an XL spreadsheet to
record the Triathlon and Cross Country finishers. Hit a button for time on
the laptop as they cross the line and put down their number. A quick

filter
when all the competitors are in and strait into prize giving. Wouldn't

that
be fantastic.
Would you know how to do this?

If you use ctrl+shift+: you only get hours and minutes. I need seconds.
I tried using =now() and a macro. Couldn't get the required result.
Any ideas?
--
Cheers!
Mrbrently



  #4   Report Post  
Mrbrently
 
Posts: n/a
Default

works perfectly--thanks!

"Mrbrently" wrote:

I'm a school sports coordinator and trying to set up an XL spreadsheet to
record the Triathlon and Cross Country finishers. Hit a button for time on
the laptop as they cross the line and put down their number. A quick filter
when all the competitors are in and strait into prize giving. Wouldn't that
be fantastic.
Would you know how to do this?

If you use ctrl+shift+: you only get hours and minutes. I need seconds.
I tried using =now() and a macro. Couldn't get the required result.
Any ideas?
--
Cheers!
Mrbrently

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click on cell-calendar drops down-click on date-date fills cell. . George Setting up and Configuration of Excel 1 April 15th 05 08:22 AM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
Syntax for inferred cell references donesquire Excel Worksheet Functions 4 April 4th 05 09:29 PM
Excel should have a feature just right click on a cell and get it. Pradeep Excel Discussion (Misc queries) 0 February 25th 05 02:51 AM
Can I use the contents of a cell to satisfy the result_vector arg. robh_2 Excel Worksheet Functions 3 February 24th 05 08:14 PM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"