Hello,
une fonction qui peut être utile :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Function ReplaceArray(ByVal strExp As String, _
ByVal strToFind As Variant, _
ByVal strToReplace As Variant) As String
Dim i As Long
If IsArray(strToFind) And IsArray(strToReplace) Then
If UBound(strToFind) = UBound(strToReplace) Then
For i = 0 To UBound(strToFind)
strExp = Replace(strExp, strToFind(i), strToReplace(i))
Next i
ReplaceArray = strExp
Else
ReplaceArray = vbNullString
End If
Else
ReplaceArray = Replace(strExp, strToFind, strToReplace)
End If
End Function |
qui permet de faire :
replaceArray(Champ, Array("-","/"), Array("",""))
Partager