Fun little exercise. I did notice some interesting things:
1. The OP says it should replace one letter with one other letter. I assume he meant "replace ALL OCCURRENCES or one letter with a different letter".
2. What about if you want to replace the letter with a string of letters? Like "Eat", replace "E" with "Wh" to get "What".
3. What about if you want to replace a string of letters with a single letter or a different string? Like "Eat", replace "at" with "el" to get "Eel".
Anyway, I probably made it way more complicated than the OP originally intended, but here's what I came up with:
Private Sub cmdNew_Click()
Dim intPos As Integer
Dim lastIntPos As Integer
' Initialize
lastIntPos = 1
Me.lblAnswer.Caption = ""
' Now iterate, looking for txtLetter value inside txtWord...
Do
intPos = InStr(lastIntPos, Me.txtWord.Text, Me.txtLetter.Text, vbTextCompare)
If intPos = 0 Then ' zero means "I didn't find it"
Exit Do
End If
' assemble the caption with the starting caption from the last iteration,
' add all the letters in-between last iteration that AREN'T getting replaced,
' then tack on the string from txtReplace
Me.lblAnswer.Caption = Me.lblAnswer.Caption & Mid(Me.txtWord.Text, lastIntPos, intPos - lastIntPos) & Me.txtReplace.Text
' Prepare for the next iteration
lastIntPos = intPos + 1
Loop
' Now pick up any leftover characters at the end of txtWord that haven't been replaced.
Me.lblAnswer.Caption = Me.lblAnswer.Caption & Mid(Me.txtWord.Text, lastIntPos + Len(Me.txtLetter.Text) - 1)
' And, we're done!
End Sub
I tested this with all the scenarios (including where the "replace" letter was not in the string at all) and it seems to work fine. And, just for your interest and edification, I included comments to help you figure out what I was doing.
Hope you enjoy it! Merry Christmas to all!