Function ReplaceSubString(strSource As String, strFind As String, strReplace As String) As String
Dim intFindPos As Integer, intStartPos As Integer
'Wenn Orgnialstring oder zu ersetzender Wert leer ist Funktion beenden und Rückgabe Orginalstring
If (strSource = "") Or (strFind = "") Then
ReplaceSubString = strSource
Exit Function
End If 'If strFind = "" Then
intStartPos = 1
intFindPos = Instr(intStartPos, strSource, strFind)
Do While intFindPos > 0
strSource = Left$(strSource, intFindPos - 1) + strReplace + Mid$(strSource, intFindPos + Len(strFind))
intStartPos = intFindPos + Len(strReplace)
intFindPos = Instr(intStartPos, strSource, strFind)
Loop
ReplaceSubString = strSource
End Function