I'm trying to make the macro find values from column A on Sheet1 in column A on Sheet2. If that value is found, then it will use Column B from Sheet1 to replace a value on Column B in Sheet2.
So Sheet1 will look like this.
A |
Annie |
B |
Billy |
C |
Charles |
Sheet2
A |
Lee |
(empty) |
(empty) |
C |
Lopez |
Wanted change in Sheet2
A |
Annie |
(empty) |
(empty) |
C |
Charles |
I've been trying to make a loop out of it, since the actual sheet will have like 40 rows to find and replace.
Dim i As Long
For i = 1 To 40
With Sheets("Sheet1" & i)
.Range("A:B").Replace What:="Sheet2(Cells(i, 2))", Replacement:="Sheet2(Cells(i, 2))", LookAt:=xlWhole
End With
Next
Bookmarks