Sub FormatDate() Dim cel As Range For Each cel In Range("A2:C" & ActiveSheet.UsedRange.Rows.Count) If InStr(1, cel.Text, ".") = 0 And InStr(1, cel.Text, ",") = 0 Then If Len(cel.Value2) > 5 Then If Not IsDate(cel.Value2) Then cel = Left$(cel.Value2, 4) & "/" & Mid$(cel.Value2, 5, 2) & "/" & Right$(cel.Value2, 2) End If End If cel.NumberFormat = "mm/dd/yyyy" End If Next End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.