Wil Moosa
Well-known Member
- Joined
- Aug 11, 2002
- Messages
- 893
The following code gives the actual time (every second adapting) in cell A47 when macro SetTime is run. What shows up is this format "15-5-2003 14:48:25". What I want is only the time format "14:48:25". Changing the cell properties does not make a change. Who can help?
Dim SchedRecalc As Date
Sub SetTime()
SchedRecalc = Now + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Recalc"
End Sub
Sub Recalc()
Range("A47").Value = Now
Call SetTime
End Sub
Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
End Sub
Dim SchedRecalc As Date
Sub SetTime()
SchedRecalc = Now + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Recalc"
End Sub
Sub Recalc()
Range("A47").Value = Now
Call SetTime
End Sub
Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
End Sub