Hello, how do I update the following code:
This one only delete the Red Combos when 2 number within the combos are the same and not all different:
example: 006, 606 [DELETE], 312 [NO ACTION]
This one only delete the Red Combos when 2 number within the combos are the same and not all different:
example: 006, 606 [DELETE], 312 [NO ACTION]
Code:
Sub DeleteRedCombos()
Dim Cnt As Integer, LastRow As Integer
LastRow = Sheets("sheet5").Cells(Rows.Count, "C").End(xlUp).Row
Do While Cnt <= LastRow
Cnt = Cnt + 1
If Sheets("sheet5").Cells(Cnt, "C").Interior.ColorIndex = 3 _
And Sheets("sheet5").Cells(Cnt, "D").Interior.ColorIndex = 3 _
And Sheets("sheet5").Cells(Cnt, "E").Interior.ColorIndex = 3 Then
If Sheets("sheet5").Cells(Cnt, "C") <> Sheets("sheet5").Cells(Cnt, "D") _
And Sheets("sheet5").Cells(Cnt, "C") <> Sheets("sheet5").Cells(Cnt, "E") _
And Sheets("sheet5").Cells(Cnt, "D") <> Sheets("sheet5").Cells(Cnt, "E") Then
With Sheets("Sheet5")
.Cells(Cnt, "C").ClearContents
.Cells(Cnt, "D").ClearContents
.Cells(Cnt, "E").ClearContents
End With
End If
End If
Loop
End Sub