Code to determine if data is filtered

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.
 
G

Guest

Several ways to check for filter, but to take yours to the next level
On Error Resume Next
ActiveSheet.ShowAllData
 
D

Dave Peterson

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

Top