Code to determine if data is filtered

  • Thread starter Thread starter excel
  • Start date Start date
E

excel

What code could I use to show all rows in the data filtering, IF data
filtering is on. I tried,
ActiveSheet.ShowAllData

but then it bombs if nothing is already filtered.
 
Several ways to check for filter, but to take yours to the next level
On Error Resume Next
ActiveSheet.ShowAllData
 
With activesheet
If .FilterMode Then
.ShowAllData
End If
end with

or just ignore the error:

on error resume next
ActiveSheet.ShowAllData
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top