Results 1 to 16 of 16

Enter Date and Time quick way

Threaded View

  1. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Enter Date and Time quick way

    Assuming you want the time to display in 12hr format:

    1:15 PM
    1:15 AM
    11:30 PM
    11:30 AM

    Either comment out or delete these lines of the code:

     Case 5 ' e.g., 12345 = 1:23:45 NOT 12:03:45
                 TimeStr = Left(.Value, 1) & ":" & _
                 'Mid(.Value, 2, 2) & ":" & Right(.Value, 2)
     Case 6 ' e.g., 123456 = 12:34:56
                 TimeStr = Left(.Value, 2) & ":" & _
                 Mid(.Value, 3, 2) & ":" & Right(.Value, 2)
    Change this line of code:

    .Value = TimeValue(TimeStr)
    To:

    .Value = Format(TimeValue(TimeStr), "h:mm am/pm")
    Last edited by Tony Valko; 09-15-2013 at 09:37 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] automatically enter time & date
    By MUDDER460 in forum Excel General
    Replies: 18
    Last Post: 12-07-2012, 06:49 AM
  2. Macro to automatically enter time & date
    By mellis123 in forum Excel General
    Replies: 6
    Last Post: 06-16-2012, 06:44 AM
  3. Enter date and time
    By akhtar151 in forum Excel General
    Replies: 5
    Last Post: 10-13-2007, 11:25 AM
  4. [SOLVED] Any quick key for entering Current Date and Time?
    By Philip in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2006, 12:25 PM
  5. Any quick key to insert current Date and Time?
    By Philip in forum Excel General
    Replies: 2
    Last Post: 01-12-2006, 12:20 PM

Tags for this Thread

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