{"id":3157,"date":"2021-03-24T00:45:24","date_gmt":"2021-03-24T07:45:24","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=3157"},"modified":"2021-03-24T00:45:26","modified_gmt":"2021-03-24T07:45:26","slug":"excel-vba-how-to-clear-all-filters","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=3157","title":{"rendered":"Excel VBA How to Clear All Filters"},"content":{"rendered":"\n<p>AutoFilterMode will be True if engaged, regardless of whether there is actually a filter applied to a specific column or not. When this happens,&nbsp;<code>ActiveSheet.ShowAllData<\/code>&nbsp;will still run, throwing an error (because there is no actual filtering).<\/p>\n\n\n\n<p>I had the same issue and got it working with<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>If (ActiveSheet.AutoFilterMode And ActiveSheet.FilterMode) Or ActiveSheet.FilterMode Then\n  ActiveSheet.ShowAllData\nEnd If\n<\/code><\/pre>\n\n\n\n<p>This seems to prevent ShowAllData from running when there is no actual filter applied but with AutoFilterMode turned on.<\/p>\n\n\n\n<p>The second catch&nbsp;<code>Or ActiveSheet.FilterMode<\/code>&nbsp;should catch advanced filters<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AutoFilterMode will be True if engaged, regardless of whether there is actually a filter applied to a specific column or not. When this happens,&nbsp;ActiveSheet.ShowAllData&nbsp;will still run, throwing an error (because there is no actual filtering). I had the same issue and got it working with This seems to prevent ShowAllData from running when there is <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=3157\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,18],"tags":[654,653,655],"class_list":["post-3157","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-microsoft-office","tag-activesheet-showalldata","tag-excel-vba-how-to-clear-all-filters","tag-vba-showalldata"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3157"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3157\/revisions"}],"predecessor-version":[{"id":3158,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3157\/revisions\/3158"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}