• remove time from date field (Excel 2003 / SP2)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » remove time from date field (Excel 2003 / SP2)

    Author
    Topic
    #449675

    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

    Viewing 1 reply thread
    Author
    Replies
    • #1103204

      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

      • #1103207

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

    • #1103319

      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’

    Viewing 1 reply thread
    Reply To: remove time from date field (Excel 2003 / SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: