Updating Code2

Status
Not open for further replies.

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
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]
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
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Either way is fine by me...I changed it, because although, the problems were similiar, it was 2 different codes, that is why I divided it in case someone has a solution for one or the other or both.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,256
Messages
6,123,913
Members
449,132
Latest member
Rosie14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top