Makro:Eine Bestimmte Zeichenfolge überall durch eine andere ersetzen

Aus XIMES

Wechseln zu: Navigation, Suche
   Function CleanStr(str As String, SuchString As String, ByeString As String) As String  'Rekursiv
       
       If SuchString = ByeString Then Stop
       If Len(SuchString) = 0 Then Stop
       
       If Len(SuchString) <= Len(ByeString) And InStr(ByeString, SuchString) Then Stop
       
       If IsError(InStr(str, SuchString)) Then
           CleanStr = str
       Else
       
           While InStr(str, SuchString) > 0
               str = Replace(str, SuchString, ByeString)
           Wend
           CleanStr = str
       End If
 
   End Function
Persönliche Werkzeuge