LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
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.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
military format of time awais Excel Discussion (Misc queries) 1 May 20th 08 01:34 PM
i want to use military format for time e.g. 07:00 as 0700 awais Excel Worksheet Functions 2 May 18th 08 04:48 PM
getting military time format within excel dgarrison Excel Discussion (Misc queries) 3 December 25th 05 10:47 PM
Entering military time into a userform WillRn Excel Programming 3 March 14th 05 03:25 PM
TextBox in UserForm with 24h time format Mika Excel Programming 1 February 1st 05 07:45 PM


All times are GMT +1. The time now is 10:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"