View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Christy Christy is offline
external usenet poster
 
Posts: 89
Default Format a Userform textbox to Military time

Thanks Nick, I will try that!

Christy ;)


"Nick Hebb" wrote:

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.