+ Reply to Thread
Results 1 to 10 of 10

Enter times in 24hr format without the need to use colon ":"

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    Sydney Aus
    MS-Off Ver
    Excel 2007
    Posts
    9

    Enter times in 24hr format without the need to use colon ":"

    I am trying to build an excel that will calculate hours worked; based on the difference between a start time and a finish time.

    I want to be able to enter times in 24hr format without the need for the Colon (ie 0730 or 1350) as my typing is poor and the colon does my head in. I have seen elsewhere that it can be done but i didnt understand the formula?

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Enter times in 24hr format without the need to use colon ":"

    Hi Excelos

    Try the forum search, this subject was only brought up the other day. See the link below.

    http://www.excelforum.com/excel-form...69#post3192269
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,464

    Re: Enter times in 24hr format without the need to use colon ":"

    This Worksheet Change Module will also help
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-12-2013
    Location
    Sydney Aus
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Enter times in 24hr format without the need to use colon ":"

    Thanks Pepe,
    I am sorry but I do not know what to do with the worksheet. How do I insert it. Thanks in anticipation.

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,464

    Re: Enter times in 24hr format without the need to use colon ":"

    Right click the sheet tab
    Select View Code - The VBA editor opens
    Copy the code in post #3 and paste it in the module
    Save via the editor as XLSM file

    The code will only work for column A If needed change Range(A:A) to what you need
    If the formatting is not what you want, manually change the column/range formatting
    Each time you enter the 4 digits, they will be changed to time

  6. #6
    Registered User
    Join Date
    04-12-2013
    Location
    Sydney Aus
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Enter times in 24hr format without the need to use colon ":"

    Hello again Pepe

    I have done as you suggest except I am unable to Save via the editor as XLSM file.

    I have "Sheet 1 (Code) but I cannot save anywhere.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,464

    Re: Enter times in 24hr format without the need to use colon ":"

    After pasting the code,while in the VBA editor click ctrl+S - Save As window opens -
    In the "Save as Type" drop down select xlsm - Enter the name you need - OK

  8. #8
    Registered User
    Join Date
    04-12-2013
    Location
    Sydney Aus
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Enter times in 24hr format without the need to use colon ":"

    Wow, You are a genius. Thank you so much. Next time your in Sydney I'll shout.

    Last question. How do I finalise the thread?

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,464

    Re: Enter times in 24hr format without the need to use colon ":"

    Edit your initial post - Click " Go Advanced" and select " solved" in the dropdown next to the title

    Thx for the compliment, but it's just a piece of code I had laying somewhere. I'm totally alien to VBA

  10. #10
    Registered User
    Join Date
    04-12-2013
    Location
    Sydney Aus
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Enter times in 24hr format without the need to use colon ":"

    Hello Pepe,

    I have the first "start" coloumn working beautifully. I edited the "A;A' to the required coloumn for the start but I cant get the finish to work. How do I get the same result for the "finish" coloumn. I have tried copying and editing the command but I have no idea. It is late here now and I must go. I will be back tomorrow and hope that you can continue to help me. Thank you.

+ 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