Public Function getcpville(cel As String, x As Long)
Dim Matches As Object
With CreateObject("vbscript.regexp")
.Global = True: .IgnoreCase = True
.Pattern = "(\d{5})\D+ france"
Set Matches = .Execute(cel)
If Matches.Count > 0 Then
If x = 1 Then
getcpville = Val(Matches(0))
ElseIf x = 2 Then
getcpville = Replace(Replace(Matches(0), Val(Matches(0)), ""), "France", "")
'ou
'getcpville = Split(Replace(Matches(0), Val(Matches(0)), ""), "France")(0)
End If
End If
End With
End Function