I need to Find & Replace based on ID#'s between two Sheets. My ID#'s are in column "A", but the data that needs to change is in column "FirstName". I've found a Macro that works except that it changes the ID# instead of the FirstName.
Here is the code:
Example image:
So, in Sheet1 the FirstName "JAMES" should change to "Jimmy", and "RONALD" should change to "Ronny" based off of finding the correct ID#.
However, the current code changes the ID# instead.
Here is the code:
Code:
Sub multiFindNReplace()
Dim myList, myRange
Set myList = Sheets("Sheet2").Range("A2:A3")
Set myRange = Sheets("sheet1").Range("A2:A28")
For Each cel In myList.Columns(1).Cells
myRange.Replace what:=cel.Value, replacement:=cel.Offset(0, 1).Value
Next cel
End Sub
Example image:
So, in Sheet1 the FirstName "JAMES" should change to "Jimmy", and "RONALD" should change to "Ronny" based off of finding the correct ID#.
However, the current code changes the ID# instead.
Last edited: