+ Reply to Thread
Results 1 to 7 of 7

Convert hh:mm to hh:mm:ss

  1. #1
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    Convert hh:mm to hh:mm:ss

    I'm trying to convert time from hh:mm to hh:mm:ss

    Example:

    My Data is: 9:38 AM
    I want it: 09:38:00

    It can either replace the current values or place in a new column.

    Would I be able to do this in a macro?
    Last edited by Pergo; 10-12-2012 at 03:07 PM.

  2. #2
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Convert hh:mm to hh:mm:ss

    perhaps like this
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Convert hh:mm to hh:mm:ss

    Hi Pergo,

    Why would you want to use VBA, if you could just enter this into a cell =NOW() and Format Cell to hh:mm:ss.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Convert hh:mm to hh:mm:ss

    Now would only work with the current/date time, right?

    Dwint, how would I be able to use that for my range. So lets say the range is C293:C600

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Convert hh:mm to hh:mm:ss

    No not really.

    You could format any Cell or range of Cells where you want the time to display as 09:15:38 to the Format
    hh:mm:ss, and it will work.

  6. #6
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Convert hh:mm to hh:mm:ss

    this code will convert all data in range c293 : c600 from hh:mm AM/PM into h:mm:ss
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Convert hh:mm to hh:mm:ss

    This works perfectly, Thanks!!!

+ 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