I have this code I use to find and replace cell values. I added an If statement to make sure one cell value does not get replaced based on the offset cell. It is not working. Need to know what I am doing wrong.
I have tried to replace the underlined code oFindRng by Activecell but this did not work neither.
I tried putting the end if after the loop and that did not work neither.
Code:
Dim oFindRng As Range
Dim Col1 As String
Col1 = "A"
Columns(Col1).Select
Set oFindRng = Columns(Col1).EntireColumn.Find(What:="65500", LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, After:=ActiveCell)
If[U][I][B] oFindRng[/B][/I][/U].Offset(0, 1).Value = "BEARING FEDERAL MOGUL" Then
ActiveCell.Value = "65500"
End If
Do Until oFindRng Is Nothing
oFindRng.NumberFormat = "@"
oFindRng.Value = "065500"
Set oFindRng = Columns(Col1).FindNext(After:=oFindRng)
Loop
I have tried to replace the underlined code oFindRng by Activecell but this did not work neither.
I tried putting the end if after the loop and that did not work neither.