I can replace values by mentioning them one by one.
I want to replace (oldarray) with (newarray) where both of them are derived from ranges. i.e. oldarray = ("a2:a5") and newarray = ("b2:b5") instead of writing them one by one.
and also I need to replace each old value with adjacent cell value
i.e. a2 replaced by b2, and a3 replaced by b3.
is that possible?
Sub ReplaceValues()
Dim NewValues() As String
Dim NewValues() As String
OldValues = Split("BMV,MERCE", ",")
NewValues = Split("Jack,Sally", ",")
For i = 0 To UBound(OldValues)
With sheets("destination").Columns("Z:Z")
.Replace What:=OldValues(i), Replacement:=NewValues(i), LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=True
End With
Next
End Sub
