Forum Discussion

Nina_SC's avatar
Nina_SC
Copper Contributor
Jun 07, 2019
Solved

Convert Text to Date Format

Hello everyone,   I'm just an excel newbie and I've been finding ways on how to convert a date text string to date format. I find it peculiar that after transferring all my CSV files through a flas...
  • Berndvbatanker's avatar
    Jun 07, 2019

    Nina_SC 

    Hi Nina,

    you can use this macro, see attached file to convert dates. It converts all dates in selection to real date.

     

    Sub KonvertDate()
    Dim rngCell As Range

    For Each rngCell In Selection
    rngCell.Value = CDate(rngCell.Value)
    Next rngCell

    End Sub

     

    Best regards from germany

    Bernd

    http://www.vba-tanker.com

Resources