Yes, you can replace them with cells on a sheet, or you could use input boxes so the user types them directly.
Sub cfuttrup()
Dim ws As Worksheet
Dim str1 As String
Dim str2 As String
Dim str3 As String
Dim str4 As String
str1 = Sheets("Sheet Name").Cells(1, "A").Value
str2 = Sheets("Sheet Name").Cells(1, "B").Value
str3 = InputBox("Enter the text to replace.")
str4 = InputBox("Enter the replacement text.")
For Each ws In ActiveWorkbook.Sheets
ws.Cells.Replace What:=str1, Replacement:=str2, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ws.Cells.Replace What:=str3, Replacement:=str4, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next ws
End Sub
Examples of each is shown in the code above.
Bookmarks