VB for excel - count time in mins ....
#1
Scooby Regular
Thread Starter
Join Date: Oct 2002
Location: ex UK [SE], now Sunshine State [QLD,AUS]
Posts: 565
Likes: 0
Received 1 Like
on
1 Post
vb for excel question [again].
easy when you know how, i'm sure !!
I've got two macro 'buttons' and want to count the time elapsed in mins between button one being clicked and button two being clicked. Approx time will be around 10 mins.
Any ideas ??
easy when you know how, i'm sure !!
I've got two macro 'buttons' and want to count the time elapsed in mins between button one being clicked and button two being clicked. Approx time will be around 10 mins.
Any ideas ??
#2
Scooby Regular
Join Date: Jul 2000
Location: Islington
Posts: 2,145
Likes: 0
Received 0 Likes
on
0 Posts
'In the bas module for the sheet (not the workbook)
Dim dTimer As Date 'variable available to the worksheet
Sub Button1_Click()
dTimer = Now 'set it to current time
End Sub
Sub Button2_Click()
MsgBox Format(Now - dTimer, "HH:mm:ss")
'Cells(2, 2) = Format(Now - dTimer, "HH:mm:ss")
End Sub
Dim dTimer As Date 'variable available to the worksheet
Sub Button1_Click()
dTimer = Now 'set it to current time
End Sub
Sub Button2_Click()
MsgBox Format(Now - dTimer, "HH:mm:ss")
'Cells(2, 2) = Format(Now - dTimer, "HH:mm:ss")
End Sub
Thread
Thread Starter
Forum
Replies
Last Post
Scott@ScoobySpares
Full Cars Breaking For Spares
61
11 January 2021 03:08 PM
Scott@ScoobySpares
Full Cars Breaking For Spares
55
05 August 2018 07:02 AM
Mattybr5@MB Developments
Full Cars Breaking For Spares
38
17 July 2016 10:43 PM
Scott@ScoobySpares
Full Cars Breaking For Spares
7
14 December 2015 08:16 AM
Mattybr5@MB Developments
Full Cars Breaking For Spares
20
22 October 2015 06:12 AM