A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
The following macro converts date strings and values in the selected range between mm/dd/yyyy and dd/mm/yyyy. The output is in the form of date values that you can format as dates via Format|Cells|Number|Date.
Sub ConvertDateFormat()
Dim DtRange As Range, oCell As Range, oTxt As String
If Selection.Cells.Count = 1 Then
Set DtRange = ActiveCell
Else
Set DtRange = Selection
End If
With Application
On Error Resume Next ' In case there are no xlConstants or convertible dates in DtRange
For Each oCell In DtRange.SpecialCells(xlConstants)
oTxt = oCell.Text
If UBound(Split(oTxt, "/")) = 2 Then _
oCell.Value = CDate(Split(oTxt, "/")(1) & "/" & Split(oTxt, "/")(0) & "/" & Split(oTxt, "/")(2))
Next oCell
End With
End Sub
Note that no conversion is performed if the date is embedded in a formula or the output would be an invalid date.
As you'll see, Anreas' claim "if the cells contains dates already, then you are one step to late" isn't right...