Hello Everyone,
Seeking for your assistance to fix how timestamping should work
I tried different ways of using Now() to store the time but when I try to it sometimes, it doesn't provide my ideal difference in (hh:mm:ss)
Or sometimes it gives me the actual time. please help
Seeking for your assistance to fix how timestamping should work
I tried different ways of using Now() to store the time but when I try to it sometimes, it doesn't provide my ideal difference in (hh:mm:ss)
Or sometimes it gives me the actual time. please help
Code:
Sub timeinout()
Time1 As Date
Time2 As Date
TimeDifference As Date
If Sheet1.Shapes(Application.Caller).TextFrame.Characters.Text = "IN" Then
Sheet1.Shapes(Application.Caller).TextFrame.Characters.Text = "OUT"
Time1 = Format(DateTime.Now, "hh:mm:ss")
ElseIf Sheet1.Shapes(Application.Caller).TextFrame.Characters.Text = "OUT" Then
Sheet1.Shapes(Application.Caller).TextFrame.Characters.Text = "IN"
Time2 = Format(DateTime.Now, "hh:mm:ss")
TimeDifference = Time1 - Time2
MsgBox (TimeDifference)
Else
'DO nothing
End If
End Sub