PDA

View Full Version : Spin Button



fiza
04-01-2010, 02:16 PM
Hi anyone,

could you help me to with a code that could increment or decrease the time in my userform with the help of a spin button.

cheers
Fiza

Bob Phillips
04-01-2010, 04:48 PM
Private Sub SpinButton1_Change()
With Me

.Label1.Caption = Format(.SpinButton1.Value / (24 * 60), "hh:mm")
End With
End Sub

Private Sub UserForm_Activate()

With Me

With .SpinButton1

.Min = 0
.Max = 24 * 60

.Value = 0
End With

.Label1.Caption = "00:00"
End With
End Sub

fiza
04-02-2010, 02:59 AM
Thanks for the help. Your code works the way as I had requested.