+ Reply to Thread
Results 1 to 3 of 3

Macro to redo date/time formats

  1. #1
    Registered User
    Join Date
    05-10-2011
    Location
    Miami
    MS-Off Ver
    Excel 2007
    Posts
    28

    Macro to redo date/time formats

    In excel 2007 I have 2 columns that I need to combine into one. A is Date in yyyymmdd format, while B is time in hhmm format, though zeros are not prefixed before 10:00! I need to somehow combine them to read mm/dd/yyyy hh:mm (ie January 1st 2012 12:34)

    The nature of the time coming without always 4 digits and without a colon is driving me nuts trying to format it all though!

    Here is a sample of my input and problem:

    20120101 20
    20120101 53
    20120101 153
    20120101 206
    20120101 235
    20120101 253

    So all of these entries are for January 1st 2012. Entries are for 00:20, 00:53, 01:53, etc.

    Thanks for the help!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro to redo date/time formats

    beng404,

    Does it have to be a macro? Attached is an example workbook based off the criteria you described. In cell C1 and copied down is this formula:
    Please Login or Register  to view this content.

    And then the cells were formatted as mm/dd/yyyy hh:mm
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-10-2011
    Location
    Miami
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Macro to redo date/time formats

    That worked wonderfully 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