EmmatheDancer
New Member
- Joined
- Sep 20, 2014
- Messages
- 11
Hi,
I have set up a userform which has several option buttons one of which I want, when selected to assign the current time in the format "hh:mm" to TimeMax. For some reason when I get a msgbox to display TimeMax it prints 00:00:00? Does anyone know how to do this?
Below is the code for the userform:
I have set up a userform which has several option buttons one of which I want, when selected to assign the current time in the format "hh:mm" to TimeMax. For some reason when I get a msgbox to display TimeMax it prints 00:00:00? Does anyone know how to do this?
Below is the code for the userform:
Code:
Private Sub Cancel_Click()
Unload Me
End Sub
Private Sub OK_Click()
Dim TimeMax As Date
Select Case True
Case Now
TimeMax = Format(Now, "hh:mm")
Case Ten
TimeMax = "10:15"
Case Twelve
TimeMax = "12:15"
Case Two
TimeMax = "14:15"
Case Four
TimeMax = "16:15"
End Select
Unload Me
Call Trial(TimeMax)
End Sub