Please show me on how to display system time with running seconds in userform - vba excel 2010
Just like visual basic timer object - but I cant find any like this in macro
Thanks...
you can do this as below (found on Ozgrid.Com Forums) :
in a UserForm with a label called Label1 put the below code
Private Sub UserForm_Initialize()
Me.Label1 = Time
Application.OnTime Time + TimeValue("00:00:01"), "Live_time"
End Sub
Private Sub UserForm_Terminate()
Application.OnTime Time + TimeValue("00:00:01"), "Live_time", , False
End Sub
in a Public module, put this code:
Sub Live_time()
Application.OnTime Time + TimeValue("00:00:01"), "Live_time"
UserForm1.Label1 = Time
UserForm1.Repaint
End Sub
then run the form with the label on it.