Hello All,
Not sure if I'm posting in the right section as my question also involves using macro to display time.
Below is the code that displays current local time in Cell A1.
Using below formula to display the time in Cell B2 after subtracting 05:00 Hrs
=A1-(5/24)
Looking for a formula that will subtract 05:30mns from Cell A1 and display time in Cell B2
Not sure if I'm posting in the right section as my question also involves using macro to display time.
Below is the code that displays current local time in Cell A1.
Code:
Public Declare Function SetTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" ( _
ByVal HWnd As Long, ByVal nIDEvent As Long) As Long
Public TimerID As Long, TimerSeconds As Single, tim As Boolean
Dim Counter As Long
'~~> Start Timer
Sub StartTimer()
'~~ Set the timer for 1 second
TimerSeconds = 1
TimerID = SetTimer(0&, 0&, TimerSeconds * 1000&, AddressOf TimerProc)
End Sub
'~~> End Timer
Sub EndTimer()
On Error Resume Next
KillTimer 0&, TimerID
End Sub
Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _
ByVal nIDEvent As Long, ByVal dwTimer As Long)
'~~> Update value in Sheet 1
Sheet1.Range("A1").Value = Time
End Sub
Using below formula to display the time in Cell B2 after subtracting 05:00 Hrs
=A1-(5/24)
Looking for a formula that will subtract 05:30mns from Cell A1 and display time in Cell B2