VBA AutoFilter color is not found bypass Debug

osmosisgg

Board Regular
Joined
Sep 13, 2011
Messages
55
Hello all. I have an autofilter function that filters by the color red as the interior color. If there is no color red to filter, I get the debug error. Is it possible to go to next and resume the macro?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hello all. I have an autofilter function that filters by the color red as the interior color. If there is no color red to filter, I get the debug error. Is it possible to go to next and resume the macro?

Please post your code
 
Upvote 0
Sub FilterRed()
'
' Filters delinquent reds
Application.ScreenUpdating = False
Windows("Book1").Activate
Sheets("AntiTerrorism").Select
ActiveSheet.ListObjects("AT").Range.AutoFilter Field:=3, Criteria1:=RGB(255 _
, 0, 0), Operator:=xlFilterCellColor
Sheets("CombatTraffic").Select
ActiveSheet.ListObjects("CB").Range.AutoFilter Field:=3, Criteria1:=RGB(255 _
, 0, 0), Operator:=xlFilterCellColor
Sheets("HIPAA").Select
ActiveSheet.ListObjects("HIP").Range.AutoFilter Field:=3, Criteria1:=RGB( _
255, 0, 0), Operator:=xlFilterCellColor
Sheets("EqualO").Select
ActiveSheet.ListObjects("EO").Range.AutoFilter Field:=3, Criteria1:=RGB(255 _
, 0, 0), Operator:=xlFilterCellColor
Sheets("SubAbuse").Select
ActiveSheet.ListObjects("SA").Range.AutoFilter Field:=3, Criteria1:=RGB(255 _
, 0, 0), Operator:=xlFilterCellColor
Sheets("ThreatAwareness").Select
ActiveSheet.ListObjects("TA").Range.AutoFilter Field:=3, Criteria1:=RGB(255 _
, 0, 0), Operator:=xlFilterCellColor
Sheets("SuicidePrev").Select
ActiveSheet.ListObjects("SP").Range.AutoFilter Field:=3, Criteria1:=RGB(255 _
, 0, 0), Operator:=xlFilterCellColor
Sheets("IA").Select
ActiveSheet.ListObjects("IA").Range.AutoFilter Field:=3, Criteria1:=RGB(255 _
, 0, 0), Operator:=xlFilterCellColor
Sheets("OpSec").Select
ActiveSheet.ListObjects("OS").Range.AutoFilter Field:=3, Criteria1:=RGB(255 _
, 0, 0), Operator:=xlFilterCellColor
Sheets("CareProviderSupp").Select
ActiveSheet.ListObjects("CPS").Range.AutoFilter Field:=3, Criteria1:=RGB( _
255, 0, 0), Operator:=xlFilterCellColor
Sheets("AntiTerrorism").Select
Windows("MASTER Civilian Training Macro.xlsm").Activate
Call SaveCiv
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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