Find cell text and replace three cell in same row

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
 
S

Shasur

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top