ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to determine if data is filtered (https://www.excelbanter.com/excel-programming/394402-code-determine-if-data-filtered.html)

[email protected]

Code to determine if data is filtered
 
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.


John Bundy

Code to determine if data is filtered
 
Several ways to check for filter, but to take yours to the next level
On Error Resume Next
ActiveSheet.ShowAllData
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


" wrote:

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.



Dave Peterson

Code to determine if data is filtered
 
With activesheet
If .FilterMode Then
.ShowAllData
End If
end with

or just ignore the error:

on error resume next
ActiveSheet.ShowAllData
on error goto 0



" wrote:

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.


--

Dave Peterson


All times are GMT +1. The time now is 02:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com