Skip to main content
4 of 6
Rollback to Revision 2

###Excel VBA, 110 bytes

This is my first entry to CodeGolf so I hope this is ok.

You enter the input word in A1 and then the letters to be replaced in B1 and the resulting word is displayed in a message box.

w = Cells(1, 1)
l = Cells(2, 1)
q = Len(w)
For i = 1 To q
    x = Left(w, 1)
    R = R + x
    If InStr(l, x) > 0 Then
        R = R + x
    End If
    w = Right(w, q - 1)
Next
MsgBox R