+ Reply to Thread
Results 1 to 4 of 4

Time Issue

Hybrid View

  1. #1
    Registered User
    Join Date
    08-13-2015
    Location
    Klerksdorp
    MS-Off Ver
    2013
    Posts
    5

    Cool Time Issue

    Hi all the experts,

    I need a little help. I am entering time into a rather large spreadsheet. I need to bypass the colon entering part as it slows the process down immensely.
    Is there anyway to just enter the 4 digits and create a cell format to change it to time. But still be able to use it in calculations.

    Thank you in advance

    Time.jpg

    http://www.excelforum.com/attachment...1&d=1457594677
    Attached Files Attached Files

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

    Re: Time Issue

    Perhaps try http://www.cpearson.com/Excel/DateTimeEntry.htm or Google around for " Military time"

  3. #3
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    512

    Re: Time Issue

    try this

    Format Time ON and Time OUT cells

    0\:00
    this inserts ":" colon into your number (it will always remain a number that looks like time)

    ie: when you input

    800 it displays as 8:00
    830 it displays as 8:30

    etc

    then copy down your required range


    in E6 put the following formula and copy down

    =IF(COUNT(B6,C6)=2,MAX(0,MIN(TEXT(C6,"00\:00")+(TEXT(B6,"00\:00")>TEXT(C6,"00\:00")))-MAX(TEXT(B6,"00\:00"))),"")
    format as [h]:mm

    I have noticed further down that you have the following formula

    D259

    =IF(G259<6/24,"SS",IF(G259>8.33/24,TIME(8,20,0),G259))
    it still gives the required result

    hope this helps you

    Toonies

  4. #4
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    512

    Re: Time Issue

    if you still want a vba solution

    this is created by on of the Excel Guru's on here(I cannot recall who) and I take no credit it's all theirs


    800 it displays as 8:00
    830 it displays as 8:30

    etc

    I have put the 1st 5 ranges in


    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    'Add additional ranges
    If Application.Intersect(Target, Range("B6:C36, B48:C78, B90:C120, B132:C162, B174:C204")) Is Nothing Then
        Exit Sub
    End If
    
    If Target.Value = "" Then
        Exit Sub
    End If
    
    Application.EnableEvents = False
    With Target
    On Error GoTo Oops
                Application.EnableEvents = False
                .Value = Dec2HM(.Value)
    Oops:
                Application.EnableEvents = True
            
        End With
    End Sub
     
     
    Function Dec2HM(iVal As Long) As Date
        ' converts 1234 to 12:34
        Dec2HM = CDate((iVal \ 100) / 24 + _
                       (iVal Mod 100) / 1440)
    End Function
    Last edited by Toonies; 03-10-2016 at 06:37 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Time is an Issue Please Help
    By Mailer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-16-2014, 10:13 AM
  2. Time Charting issue, please help
    By vpnvipin in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-29-2012, 11:48 AM
  3. Time issue
    By Zeezar in forum Excel General
    Replies: 5
    Last Post: 09-15-2009, 09:18 AM
  4. Time issue
    By Zeezar in forum Excel General
    Replies: 5
    Last Post: 09-04-2009, 10:56 AM
  5. time issue
    By iwzhidden in forum Excel General
    Replies: 4
    Last Post: 08-28-2008, 09:44 AM
  6. Time issue
    By jcc31 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-05-2007, 05:15 PM
  7. Time issue
    By segger in forum Excel General
    Replies: 3
    Last Post: 02-28-2007, 12:55 PM
  8. Date time issue
    By Flash in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-25-2006, 08:05 AM

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