0
How to capture an Excel autofilter criterion that is based on cell color?
Code:
Sub GetCellColorCriteria()
With ActiveSheet
If .AutoFilterMode Then
With .AutoFilter.Filters(1)
If .On Then
If .Operator = 8 Then 'xlFilterCellColor = 8
c1 = .Criteria1 '<<<< this line generate an error;
vprov2 = RGB(255, 0, 0)
If .Criteria1 = vprov2 Then '<<<< this line generate an error;
vprov = True
End If
End If
End If
End With
End If
End With
End Sub