Find cell text and replace three cell in same row

  • Thread starter Thread starter jerry
  • Start date Start date
J

jerry

I need to create a macro to find cells in a column that contain specified
text and replace adjacent cells in the same row with specific text
 
Hi

Check if the following code helps

Public Sub Sample_Find_N_Replace()

Dim rFND

Set rFND = ActiveSheet.Range("A:A").Find(what:="SampleText",
LookIn:=xlValues, lookat:=xlPart)
If Not rFND Is Nothing Then
' Next Column
rFND.Offset(0, 1) = "Temp"

' Four Columns after A - i.e, Column E
rFND.Offset(0, 4) = "Temp2"
End If


End Sub

Cheers
 
Back
Top