+ Reply to Thread
Results 1 to 7 of 7

Time format

Hybrid View

kras Time format 11-16-2007, 07:27 AM
sweep Hi, You can convert the... 11-16-2007, 08:03 AM
kras Hi Dave, Thank you for... 11-16-2007, 08:45 AM
Richard Schollar Hi Kras You'd need some... 11-16-2007, 08:56 AM
Dean England Here's something I put... 11-16-2007, 08:59 AM
kras Thank you both Richard and... 11-17-2007, 02:02 AM
Dean England Glad to have helped. Thanks... 11-17-2007, 08:38 AM
  1. #1
    Registered User
    Join Date
    11-09-2005
    Posts
    42

    Time format

    Hi,

    In order a cell to dispaly the following time format hh:mm:ss I need to format it to Time or Custom format. Then, to enter a time I need to type hour, minutes and seconds (for example 13:58:06), using : as a separator between them. My question is: Is it possible to format a cell in such a way so that I could enter time without using : as a separator for hours, minutes and seconds? For example, I would like to enter 135806 and have 13:58:06 displayed on a cell.

    Thank you,

    kras

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Hi,

    You can convert the string of six numbers into a colon separated time like this:

    =LEFT(A1,2)&":"&MID(A1,3,2)&":"&RIGHT(A1,2)
    Last edited by Leith Ross; 11-19-2007 at 02:44 AM.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    11-09-2005
    Posts
    42
    Hi Dave,

    Thank you for your reply.

    It works when you refer to other cell in the workbook. The problem is that I would like to have it displayed in the same cell I enter the time (for example, I type 135608 in A1 and I would like to have 13:56:08 in A1). Perhaps, it is a custom formatting issue, but I couldn't figure it out.


    kras

  4. #4
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi Kras

    You'd need some VBA code attached to a worksheet event to achieve this - you can't do it just thru number formatting I'm afraid.

    Richard

  5. #5
    Forum Contributor
    Join Date
    08-28-2006
    Posts
    280
    Here's something I put together for someone a week or so ago. See if the attachment is what you want. The range can be changed to suit your needs.

    Dean
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-09-2005
    Posts
    42
    Thank you both Richard and Dean.

  7. #7
    Forum Contributor
    Join Date
    08-28-2006
    Posts
    280
    Glad to have helped. Thanks for the feedback.

    Dean

+ 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