Format a Userform textbox to Military time
Try something like:
Private Sub UserForm_Initialize()
Dim ws As Worksheet
Set ws = ActiveSheet
TextBox1.Text = Format$(ws.Range("A1"), "H:mm")
Set ws = Nothing
End Sub
Note: the capital 'H' in the format string is important. If you use a
lowercase 'h' then you'll get a 12-hour clock value.
|