Hello,
I'm trying to populate a textbox with a live countdown based on the difference between two dates. I have the following textboxes:
Textbox1: formatted with Now()
Textbox2: Static date (12 Sep 23)
Textbox3: I want a running countdown that give me the remaining days, hours, minutes, and seconds
I found a VBA code; however, it only gives me a strange date and the hh:mm:ss plus it crashes my form and freezes excel. This is what I have:
Private Sub UserForm_Activate()
Dim remTime As Date
While True
remTime = DateValue("12 Sep 2023") + TimeValue("00:00:00") - Now
Me.Label1 = Int(remTime) & " Days " & Format(remTime - Int(remTime), "D HH:MM:SS")
Me.Repaint
Application.Wait Now + #12:00:01 AM#
Wend
End Sub
I'm trying to populate a textbox with a live countdown based on the difference between two dates. I have the following textboxes:
Textbox1: formatted with Now()
Textbox2: Static date (12 Sep 23)
Textbox3: I want a running countdown that give me the remaining days, hours, minutes, and seconds
I found a VBA code; however, it only gives me a strange date and the hh:mm:ss plus it crashes my form and freezes excel. This is what I have:
Private Sub UserForm_Activate()
Dim remTime As Date
While True
remTime = DateValue("12 Sep 2023") + TimeValue("00:00:00") - Now
Me.Label1 = Int(remTime) & " Days " & Format(remTime - Int(remTime), "D HH:MM:SS")
Me.Repaint
Application.Wait Now + #12:00:01 AM#
Wend
End Sub