I must be overlooking something as no matter what I try the Replace function keeps replacing the string on the sheet that I want it to exclude.
I've tried with and without the quotes around the sheet names. I'm stumped
Sub ReplacingTest()
Dim Sh As Object
For Each Sh In ActiveWorkbook.Worksheets
If Sh.Name <> BackUp And Sh.Name <> Options Then
Sh.Cells.Replace What:="VLOOKUP(""19A19"",Options!$F$9:$H$45,3,FALSE)", Replacement:="123456789", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End If
Next Sh
End Sub
Bookmarks