Type Adrs
Adresse As String
Cp As String
ville As String
End Type
Sub test2()
Dim ad As Adrs, cel As Range
Set plage = Feuil2.Range("c1:c" & Cells(Rows.Count, "C").End(xlUp).Row)
For Each cel In plage.Cells
ad = Cp(cel.Value)
cel = ad.Adresse
cel.Offset(0, 1) = ad.Cp & " " & ad.ville
Next
End Sub
Function Cp(ad As String) As Adrs
Dim t, i As Integer
Dim ville As Boolean
t = Split(ad)
For i = UBound(t) To 0 Step -1
If IsNumeric(t(i)) And Len(t(i)) = 5 Then
Cp.Cp = t(i)
ville = True
Else
If ville = False Then
Cp.ville = t(i) & " " & Cp.ville
Else
Cp.Adresse = t(i) & " " & Cp.Adresse
End If
End If
Next
End Function