Hi I'm faced with an error message when no cells are filtered for selection.
How can I correct the error by getting it to continue with the next worksheet?
Thanks in advance!
Private Sub FormatFilteredRows()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set MySheets = ActiveWindow.SelectedSheets
For Each Worksheet In MySheets
Worksheet.Select
ActiveSheet.UsedRange
LastRow = ActiveCell.SpecialCells(xlLastCell).Row
Rows("3:3").Select
Selection.AutoFilter
Selection.AutoFilter Field:=15, Criteria1:="=*Reclass*", Operator:=xlOr, Criteria2:="=*Contra*"
Range(Range("C4"), Range("C3").End(xlToRight).Offset(LastRow - 4, -2)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.SpecialCells(xlCellTypeConstants, 23).Select
With Selection.Interior
.ColorIndex = 24
.Pattern = xlSolid
End With
Selection.AutoFilter
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Bookmarks