Option Explicit
Sub convertDate()
Dim dl As Long, I As Long, cell As Range, Rng As Range, Ws As Worksheet
For Each Ws In ThisWorkbook.Worksheets
If Ws.Name <> "RECAP" Then
With Ws
dl = .Range("A" & Rows.Count).End(xlUp).Row
Set Rng = .Range("H4:J" & dl)
For Each cell In Rng
If Not IsDate(cell) Then
cell.NumberFormat = "General"
If Len(cell) = 8 Then
cell = Mid(cell, 3, 2) & "/" & Left(cell, 2) & "/" & Right(cell, 4)
Else
cell = Mid(cell, 2, 2) & "/" & Left(cell, 1) & "/" & Right(cell, 4)
End If
End If
Next
Rng.NumberFormat = "m/d/yyyy"
End With
End If
Next Ws
MsgBox "Fin de traitement des dates!", vbInformation, "DATE CONFORME"
End Sub