WARNING: New to VBA please be very detailed.
I need a solution to a several of problems that I am having creating this userform in vba in excel 2007. I have a label1 that displays test time. A textbox for the user to enter Production time and a label2 that would be used to display the difference between times.
What I would like to do is ask the user for a production time and the test time will be equal to the current time. Once they enter in information I would like the time difference to be displayed in label2. But the method below used doesn't work. Also is there a way to display time difference automatically. Once they enter in production time it displays the time difference immediately no clicking on buttons. Here's what I have so far.Thanks.
Code:
Private Sub UserForm_Initialize()
Dim StartTime As String
Dim StopTime As String
Dim ElapseTime As Double
StopTime = LblTestTime2
StartTime = txtProductionTime
ElapseTime = (StopTime - StartTime) / 60
'ElapseTime.Caption = Format(ElapseTime, "hh:mm")
'Sets Test Time
LblTestTime2.Caption = Format(Time, "hh:mm")
End Sub