Hi all,
I understand there's already been several posts re: this in the past, but could someone give me an example code and where to place it exactly within my existing code? Below is the code I am using. It's basically for a time & motion tracking file
Sub startStopTimer()
If Range("timer.button.label") = "Start" Then
Range("time.stamp.start").Offset(Range("count.of.timestamps") + 1).Value = Now
Range("timer.button.label") = "Stop"
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -2).Value = Range("activity")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -1).Value = Range("lob")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -5).Value = Range("employee.id")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -4).Value = Range("employee.name")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -3).Value = Range("employee.dept")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), 3).Value = Range("transaction.id")
Else
Range("time.stamp.start").Offset(Range("count.of.timestamps"), 1).Value = Now
Range("time.stamp.start").Offset(Range("count.of.timestamps"), 2).Value = Now - Range("time.stamp.start").Offset(Range("count.of.timestamps"))
Range("timer.button.label") = "Start"
Range("D9").Select
Selection.ClearContents
Range("D9").Select
End If
End Sub
I've already tried several suggestions I found in previous threads... Please advise I'm at my wit's end.
Cheerio
I understand there's already been several posts re: this in the past, but could someone give me an example code and where to place it exactly within my existing code? Below is the code I am using. It's basically for a time & motion tracking file
Sub startStopTimer()
If Range("timer.button.label") = "Start" Then
Range("time.stamp.start").Offset(Range("count.of.timestamps") + 1).Value = Now
Range("timer.button.label") = "Stop"
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -2).Value = Range("activity")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -1).Value = Range("lob")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -5).Value = Range("employee.id")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -4).Value = Range("employee.name")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), -3).Value = Range("employee.dept")
Range("time.stamp.start").Offset(Range("count.of.timestamps"), 3).Value = Range("transaction.id")
Else
Range("time.stamp.start").Offset(Range("count.of.timestamps"), 1).Value = Now
Range("time.stamp.start").Offset(Range("count.of.timestamps"), 2).Value = Now - Range("time.stamp.start").Offset(Range("count.of.timestamps"))
Range("timer.button.label") = "Start"
Range("D9").Select
Selection.ClearContents
Range("D9").Select
End If
End Sub
I've already tried several suggestions I found in previous threads... Please advise I'm at my wit's end.
Cheerio