Thanks, I am inexperienced in VBA, could you please help me ? How can I do in this example? Sergio
Dim FirstString As String Dim SecondString As String Dim WhereInString As Integer Dim WholeSentence As Variant Dim ReplaceWith As String Dim I As Integer FirstString = "The big brown fox jumps over the log." SecondString = "fox" WhereInString = InStr(FirstString, SecondString) If WhereInString Then MsgBox SecondString & " occurs " & Str(WhereInString) & " characters from the beginning of the sentence." ReplaceWith = InputBox("What should I replace 'fox' with?") WholeSentence = Split(FirstString, " ") FirstString = "" For I = 0 To UBound(WholeSentence) If WholeSentence(I) = SecondString Then WholeSentence(I) = ReplaceWith FirstString = FirstString & " " & WholeSentence(I) Next I MsgBox Trim$(FirstString) HTH.