title: VBA check sheet for filtered data
body: <p>Is there any way to check if sheets have any filtered data (If there is filtered data, then clear filter, else do nothing)? I have this code here, but I don't know how to write second part:</p>
  
  <pre><code>Sub ProtectAll()
  
  Dim wSheet          As Worksheet
  
  For Each wSheet In Worksheets
  
  With wSheet
  If .AutoFilterMode Then
              .ShowAllData
              .Cells.Locked = True
              .Cells.FormulaHidden = False
             '.Range(wSheet.Cells(12, 1), wSheet.Cells(12, 18)).AutoFilter
             '.Protect Password:=Pwd, AllowFiltering:=True
  
  ElseIf ??? Then
  End If
  End With
  
  Next wSheet
  End Sub
  </code></pre>