If then replace macro

dellennon

New member
Joined
Aug 13, 2013
Messages
3
Reaction score
0
Points
0
Hello to all,
I need help to find a macro that will search a range of cell (Cell Y) of a certain value(non numeric) and then replace the corresponding value of range of cell(Cell X) to that certain value from cell A. I have built one but it doesn't work, it replaces all value of Y to "CC"
Thanks


Sub FindCC16()
Dim X As Range
Dim Y As Range
For Each X In Range("C3:C10000")
For Each Y In Range("D3:D10000")
If Y.Value like "CC" Then
X.Offset(, 1).Value = "CC"
Exit For
End If
Next Y
Next X





End Sub
 
Back
Top