﻿{"id":3833,"date":"2013-09-17T12:00:32","date_gmt":"2013-09-17T03:00:32","guid":{"rendered":"http:\/\/fujiitoshiki.com\/improvesociety\/?p=3833"},"modified":"2017-04-27T16:09:43","modified_gmt":"2017-04-27T07:09:43","slug":"how-to-remove-autofilter-of-all-worksheets-in-multiple-excel-workbooks","status":"publish","type":"post","link":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3833","title":{"rendered":"How to remove AutoFilter of all worksheets in multiple Excel workbooks?"},"content":{"rendered":"<div class=\"theContentWrap-ccc\"><p>It&#8217;s hard to remove manually AutoFilter of worksheets in multiple workbooks. I&#8217;d like to describe how to remove it with VBA. <\/p>\n<pre class=\"toolbar-overlay:true lang:vb decode:true\">Option Explicit\r\n\r\nSub RemoveAutoFilter()\r\n    Dim Wb      As Workbook\r\n    Dim Sh      As Worksheet\r\n    Dim myPath  As Variant\r\n    Dim i       As Long\r\n    Application.ScreenUpdating = False\r\n    myPath = Application.GetOpenFilename(FileFilter:=\"Microsoft Excel Book,*.xls?\", MultiSelect:=True)\r\n    If TypeName(myPath) = \"Boolean\" Then Exit Sub\r\n    For i = LBound(myPath) To UBound(myPath)\r\n        Set Wb = Workbooks.Open(myPath(i))\r\n        For Each Sh In Wb.Worksheets\r\n            If Sh.AutoFilterMode Then\r\n                Sh.AutoFilterMode = False\r\n            End If\r\n        Next Sh\r\n        Wb.Save\r\n        Wb.Close\r\n    Next i\r\n    Application.ScreenUpdating = True\r\nEnd Sub\r\n<\/pre>\n<p>Reference:<br \/>\n<a href=\"\/\/msdn.microsoft.com\/en-us\/library\/office\/ff834966.aspx\" title=\"Application.GetOpenFilename Method (Excel)\" target=\"_blank\">Application.GetOpenFilename Method (Excel)<\/a><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>It&#8217;s hard to remove manually AutoFilter of worksheets in multiple workbooks. I&#8217;d like to describe  &hellip; <a href=\"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3833\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;How to remove AutoFilter of all worksheets in multiple Excel workbooks?&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":6026,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-3833","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/3833","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3833"}],"version-history":[{"count":8,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/3833\/revisions"}],"predecessor-version":[{"id":7758,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/3833\/revisions\/7758"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/media\/6026"}],"wp:attachment":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}