+ Reply to Thread
Results 1 to 10 of 10

Userform Label Caption - How To Set It To Display Military Time?

  1. #1
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Userform Label Caption - How To Set It To Display Military Time?

    Hi all,

    just a wee problem for someone to take a look at for me, please?

    I can get a label caption to show the current time using...
    Please Login or Register  to view this content.
    but since we use military time at work, how do I get it to display that way?

    Thanks in advance for any suggestions.

    Cheers,

    AJ
    Last edited by ScotyB; 02-15-2013 at 06:27 PM. Reason: To mark as 'Solved'
    Always grateful for the help here - thanks.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,760

    Re: Userform Label Caption - How To Set It To Display Military Time?

    Not clear about what you are trying to do Can you please explain it a bit more for assistance?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,619

    Re: Userform Label Caption - How To Set It To Display Military Time?

    Change the format string to suit.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Re: Userform Label Caption - How To Set It To Display Military Time?

    Hiya sixthsense - just trying to set a userform label to display military time - the first line is meant to set the time and the second line is meant to update it every 5 seconds.

    Hiya Norie - thanks for the suggestion - I'll try it out and get back to you...

    Cheers,

    AJ

  5. #5
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Re: Userform Label Caption - How To Set It To Display Military Time?

    Norie,

    the caption will show the time okay but bugs out at the OnTime line saying that "argument is not optional" - am I missing something to get it to update the time every 5 seconds?

    Cheers,

    AJ

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,760

    Re: Userform Label Caption - How To Set It To Display Military Time?

    May be try like this...

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Re: Userform Label Caption - How To Set It To Display Military Time?

    Thanks, sixthsense, but that didn't work for me (i'm using Excel 2007 at home and 2010 at work if that makes a difference).

    I'll expand on what I'm after...

    1. User clicks a command button which opens my userform (that part works okay)
    2. I'd like the label caption (Label1) to display the time (military) and update every 5 seconds when the userform initialises
    3. Another command button saves the time value (and several other values in text, combo, or list boxes) to a table. (This part works okay too.)

    It's just step 2 that's causing me the most grief - I can't quite get it to work the way I would like...

    Cheers,

    AJ

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,760

    Re: Userform Label Caption - How To Set It To Display Military Time?

    Its working fine for me and the version wont be an issue. Check the userform name and Label name.

    If you are getting any error then please share the screen shot of line on which you are getting the error message for better understanding

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,760

    Re: Userform Label Caption - How To Set It To Display Military Time?

    In addition to the previous post use ApplyTime macro for your command button.

  10. #10
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Re: Userform Label Caption - How To Set It To Display Military Time?

    Hiya sixthsense (and Norie),

    all is good now - thanks for your help on this one.

    Cheers,

    AJ

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1