Hi
Is it possible to have a macro to check if another macro was activated? I have the following macro that insert the starting time in a column when you click on the start button.
and the following macro to insert the stop time when clicking on the Stop button
Basically i want it before it insert the start time in column K it must check that the last entry in column k must have a value in the same row in column l, if there is no entry in column L in that row it must give an error message "You already pressed Start".
Is it possible to have a macro to check if another macro was activated? I have the following macro that insert the starting time in a column when you click on the start button.
Code:
Sub setStart()
Call unprotect
If Range("F1") = Empty Or Range("F2") = Empty Then
' MsgBox "Cell A5 is empty!"
Else
Dim NextRow As Long
NextRow = GetLastRow("K") + 1
With Range("K" & NextRow)
.Value = Now
.NumberFormat = "yyyy/mm/dd HH:mm:ss"
End With
End If
' ActiveSheet.CommandButton1.Caption = "STOP"
Call protect
End Sub
and the following macro to insert the stop time when clicking on the Stop button
Code:
Sub setStop()
Call unprotect
' Call Score
If Range("F1") = Empty Or Range("F2") = Empty Then
MsgBox "Please Ensure that you clicked on 'Play' before you click on 'Stop'!"
Else
Dim NextRow As Long
NextRow = GetLastRow("L") + 1
With Range("l" & NextRow)
.Value = Now
.NumberFormat = "yyyy/mm/dd HH:mm:ss"
End With
calcElapsedTime (NextRow)
' ActiveSheet.CommandButton1.Caption = "START"
Call Score
End If
Call protect
End Sub
Basically i want it before it insert the start time in column K it must check that the last entry in column k must have a value in the same row in column l, if there is no entry in column L in that row it must give an error message "You already pressed Start".