Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2003
    Location
    Omaha, Nebraska, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    'Text' Dates (Excel 97 SR2)

    A am working with a great deal of data that includes a transaction date entered in each row as as text string (example "15-Feb-03"). I need to sort the data based on the date field, but am having trouble converting the text field to a date field. I am familiar with the DATEVALUE function, but I am not sure how to use it to convert several hundred text fields at once. Thanks in advance for your assistance.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: 'Text' Dates (Excel 97 SR2)

    You can either run the conversion with DateValue() in another column, and then copy the values over the original column, or you can run a macro like this on the selected cells:

    Sub converttext2date()
    Dim rCell As Range
    Selection.NumberFormat = "mm/dd/yyyy" ' or other desired format
    For Each rCell In Selection.Cells
    On Error Resume Next
    rCell.Value2 = CDate(rCell.Value)
    Next rCell
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Lounger
    Join Date
    Jan 2003
    Location
    Omaha, Nebraska, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'Text' Dates (Excel 97 SR2)

    Thanks for the Quick response. When I get back to the office, I'll give it a try.

Posting Permissions

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