J'aimerai supprimer via VBA tous les caracteres speciaux contenus dans une feuille excel et les remplacer par un espace (e.g. [***urgent !*** A envoyer] @ PAR urgent a envoyer). Apres moulte recherche, je n'ai pas trouve une macro qui fonctionne ...
Function EPURE$(ByVal txt$, xrg As Range)
Dim tablo, i&
tablo = xrg 'caractères spéciaux
For i = 1 To UBound(tablo): txt = Replace(txt, tablo(i, 1), tablo(i, 2)): Next
EPURE = Application.Trim(txt) 'au cas où...
End Function
Function EPURE$(txt$)
Dim tablo, t
tablo = [Liste] 'caractères spéciaux
For Each t In tablo
txt = Application.Trim(Replace(txt, t, Application.VLookup(t, tablo, 2, 0)))
Option Explicit
Function replaceonebyone(chain As String, table)
Dim t, i&
t = table.Value
For i = 1 To UBound(t)
replaceonebyone = Replace(chain, CStr(t(i, 1)), CStr(t(i, 2)))
Next
End Function