Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    Boston, Massachusetts, USA
    Posts
    167
    Thanks
    1
    Thanked 0 Times in 0 Posts

    remove time from date field (Excel 2003 / SP2)

    Monday, Monday! I can't for the life of me remember how to remove the time value out of a field to be left with the date only. I don't want to change the formatting, I actually want the date only because the time is making my calculations go haywire that I want based on date only. Help me!
    6/1/2007 3:38:00 AM
    thanks
    christine

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: remove time from date field (Excel 2003 / SP2)

    Say you have a date/time in A1. You could put this formula in B1: =INT(A1) and format it as a date, then use the value in column B.

    Or you can run the following macro (select some cells before running it):

    Sub ConvertDates()
    Dim oCell As Range
    For Each oCell In Selection
    oCell = Int(oCell)
    Next oCell
    Selection.NumberFormat = "mm/dd/yyyy"
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    Boston, Massachusetts, USA
    Posts
    167
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: remove time from date field (Excel 2003 / SP2)

    So are you actually some great ancient superhero or is that just in my imagination?!?!?!?!? Many thanks yet again!
    thanks
    christine

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: remove time from date field (Excel 2003 / SP2)

    I'm ancient <img src=/S/gramps.gif border=0 alt=gramps width=20 height=20> but not a superhero <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: remove time from date field (Excel 2003 / SP2)

    A bit late but you could also do a find/replace:
    Find: ' *' (space followed by asterisk, without the quotes)
    Replace: leave blank.
    Select 'Replace All'
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •