Excel - Click a Cell and it auto updates the MM:SS

AdampJ91

New Member
Joined
Mar 25, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
Hello,

I am trying to build an excel database which will allow me to auto update the MM:SS of a cell just by clicking the cell. Is this possible for example;

Cell A2 clicked and this updates with 02:24 as an example. I could then populate the rest of the spreadsheet as needed with content.

Any help would be appreciated?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Give something like this a try...add it to the sheet you're working on and update the range to the desired column where MM:SS should appear.

VBA Code:
Private Sub worksheet_selectionchange(ByVal target As Range)
If target.CountLarge > 1 Then Exit Sub
If Not Intersect(target, Range("C2:C200")) Is Nothing Then
    target.Value = Format(Now, "mm:ss")
End If
End Sub
 
Upvote 0
edit: Change the target.value line to this: target.Value = Format(Now, "HH:mm:ss")

Then change the format of that range to time mm:ss
 
Upvote 0
Thanks for the reply. That doesn’t seem to work for me, I update the VBA, but when I click on the cell required it wants me to add something, whereby I want it to populate that I have clicked the cell without me needing to enter a manual time?
 
Upvote 0
Ok, I have got it working.

However, I would need it to populate the minute/second from a stop watch feature. I am using the database to time incidents in a football match. So would start a timer (if possible) and then when an incident occurs click a cell in range A3-A200 which will pick up the stopwatch and log the time?
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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