rsmeyerson
Board Regular
- Joined
- Nov 29, 2014
- Messages
- 104
Hello,
I'm having trouble getting the 'AND' portion to work in the example code below. My issue is that FORMULA1 is being inserted into Column S when there is a Column J 'OR' match but not a Column E "NEW" match. Any help is greatly appreciated.
I'm having trouble getting the 'AND' portion to work in the example code below. My issue is that FORMULA1 is being inserted into Column S when there is a Column J 'OR' match but not a Column E "NEW" match. Any help is greatly appreciated.
VBA Code:
With Sheets("Retail")
Last = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = Last To 2 Step -1
If (.Cells(i, "E").Value) = "NEW" And (.Cells(i, "J").Value) Like "*xxx*" Or (.Cells(i, "J").Value) Like "*yyy*" Or (.Cells(i, "J").Value) Like "*zzz*" Then
.Cells(i, "S").Value = "FORMULA1"
Else
.Cells(i, "S").Value = "FORMULA2"
End If
Next i
End With