zoomwaffles
New Member
- Joined
- Sep 12, 2014
- Messages
- 4
I'm trying to create a macro that searches for the contents of one cell and replaces it with the contents of another cell, and then repeats with two different cells.
I have "WK51" in cell K2, and "WK52" in cell K3... that's the first replacement. Then I have "WK 51" in cell L2, and "WK 52" in cell L3... that's the second replacement.
I have the code below, and it works for the first replacement, but does not execute the second replacement. What am I doing wrong?
I have "WK51" in cell K2, and "WK52" in cell K3... that's the first replacement. Then I have "WK 51" in cell L2, and "WK 52" in cell L3... that's the second replacement.
I have the code below, and it works for the first replacement, but does not execute the second replacement. What am I doing wrong?
Code:
Sub Update_Week_Number()
Dim Findtext As StringDim Replacetext As String
Findtext = Range("K2").Value
Replacetext = Range("K3").Value
Findtext = Range("L2").Value
Replacetext = Range("L3").Value
Cells.Replace What:=Findtext, replacement:=Replacetext, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub