Function ReplaceCharacter(stringToChange$, charToReplace$, replaceWith$) As String
Dim ln, n As Long Dim NextLetter As String Dim FinalString As String Dim txt, char, rep As String txt = stringToChange$ char = charToReplace$ rep = replaceWith$ ln = Len(txt) For n = 1 To ln Step 1 NextLetter = Mid(txt, n, 1) If NextLetter = char Then NextLetter = rep End If FinalString = FinalString & NextLetter Next n Replace_Character = FinalString End Function |