I have a range where "D12345" is listed numerous times in the range and has some text after it. Such as: "D12345 MyDescription". I would like to do a search and replace on every cell where "D12345" is found but replacing it with "D12345 Legal". One point I need to make is that text "D12345" may be different in the range. It may be listed as "D12345 MyDescription01", "D12345 MyDescription02" or "D12345 MyDescription03". Either way the end result will be "D12345 Legal".
Code: Select all
Sub Find_Replace()
Dim SFind As String
Dim SReplace As String
SFind = "D12345"
SReplace = "D12345" & " Legal"
Range("D5:D1676").Replace _
What:=SFind, Replacement:=SReplace, _
LookAt:=xlWhole, MatchCase:=False
End Sub
John