1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Private Sub Frame1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim LeControl As Object
Dim Num As Byte
Dim Number As String
For Each LeControl In Frame1.Controls
If Left(LeControl.Name, 7) = "TextBox" Then
If Controls(LeControl.Name).BackColor = RGB(225, 225, 225) Then
Num = Right(LeControl.Name, Len(LeControl.Name) - 7)
Number = "h & Num"
Number = Replace(Controls(LeControl.Name).Value, ".", ":")
Controls(LeControl.Name) = Format(Controls(LeControl.Name).Value, "hh\H mm")
End If
Controls(LeControl.Name).BackColor = RGB(255, 255, 255)
End If
Next
Stop
End Sub |