asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,286
- Office Version
- 2013
- Platform
- Windows
Good Day,
With below code when its running userform1 label1 caption shows false values.
Is there any way to fix that?
Thanks in advance.
With below code when its running userform1 label1 caption shows false values.
Is there any way to fix that?
Thanks in advance.
VBA Code:
Private Sub CommandButton1_Click()
a = UserForm2.TextBox1 = Value
b = UserForm2.TextBox2 = Value
c = UserForm2.TextBox3 = Value
d = UserForm2.TextBox4 = Value
e = UserForm2.TextBox5 = Value
f = UserForm2.TextBox6 = Value
n = a * 10 * 60 * 60 + b * 60 * 60 + c * 10 * 60 + d * 60 + e * 10 + f
Unload Me
UserForm1.Show
UserForm1.Label1.Caption = a & b & ":" & c & d & ":" & e & f
For i = 1 To n
Application.Wait (Now + #12:00:01 AM#)
DoEvents
UserForm1.Label1.Caption = Format(DateAdd("s", -1, UserForm.Label1.Caption), "hh:mm:ss")
UserForm1.Label3.Width = 858 - 858 * i / n
If UserForm1.Label1.Caption < #12:00:11 AM# Then
UserForm1.Label3.BackColor = vbRed
Beep
End If
Next i
End Sub