Welcome. I try to search for specific values in a range and replace them with other values when checking their presence. I tried to implement this using the following code, but it did not work. I hope to find someone to help me with this
VBA Code:
Option Explicit
Sub CleanUpOutlier()
Dim lr&, i&, j&, rng, oldData, newData
lr = Cells(Rows.Count, "C").End(xlUp).Row
rng = Range("E11:Q" & lr).Value
oldData = Array("t1", "t566", "m45", "w78", "tr2")
newData = Array("machine1", "machine15", "machine166", "machine166", "machine19")
For i = 1 To lr
For j = 0 To UBound(oldData)
If rng Like oldData(j) Then rng = newData(j)
Next
Next
Range("E11:Q" & lr).Value = rng
End Sub