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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
How 'bout sticking to your Original Post?

Note that in neither post did you indicate what you wanted updated, which would help.

Smitty
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
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.
 
Status
Not open for further replies.

Forum statistics

Threads
1,141,016
Messages
5,703,751
Members
421,312
Latest member
Mooncake1

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
Top