{"id":3500,"date":"2015-09-07T08:31:30","date_gmt":"2015-09-06T23:31:30","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=3500"},"modified":"2015-09-07T08:31:30","modified_gmt":"2015-09-06T23:31:30","slug":"rangeautofilter2","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/rangeautofilter2\/","title":{"rendered":"\u30aa\u30fc\u30c8\u30d5\u30a3\u30eb\u30bf\uff08AutoFilter \u30e1\u30bd\u30c3\u30c9\uff09"},"content":{"rendered":"<h2>AutoFilter \u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>AutoFilter<\/strong> ( [ <em>field<\/em>, <em>criteria1<\/em>, <em>operator<\/em>, <em>criteria2<\/em>, <em>visibledropdown<\/em> ] )<\/p><\/div>\n<br \/>\n<h3>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>field&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a3\u30eb\u30bf\u30fc\u306e\u5bfe\u8c61\u3068\u306a\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u756a\u53f7\u3092\u6574\u6570\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\u5bfe\u8c61\u3068\u306a\u308b\u7bc4\u56f2\u306e\u6700\u3082\u5de6\u5074\u306e\u5217\uff08\u30d5\u30a3\u30fc\u30eb\u30c9\uff09\u304c\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u756a\u53f7 1 \u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u8907\u6570\u306e\u5217\uff08\u30d5\u30a3\u30fc\u30eb\u30c9\uff09\u3092\u307e\u3068\u3081\u3066\u6271\u3044\u305f\u3044\u5834\u5408\u306f\u3001\u914d\u5217\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\t\u3000\uff08\u4f8b\uff09field := Array(1,3,6)<\/li>\n<li>criteria1&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u62bd\u51fa\u6761\u4ef6\u3068\u306a\u308b\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u62bd\u51fa\u6761\u4ef6 1 \uff09<\/li>\n<li>operator&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a3\u30eb\u30bf\u30fc\u306e\u7a2e\u985e\u3092 <strong>XlAutoFilterOperator \u5217\u6319\u578b<\/strong> \u306e\u5b9a\u6570\u307e\u305f\u306f\u305d\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffccc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"80\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"320\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlAnd<\/td>\n<td width=\"80\" align = \"center\">1<\/td>\n<td width=\"320\">\u62bd\u51fa\u6761\u4ef6 1 \u3068\u62bd\u51fa\u6761\u4ef6 2 \u306e\u4e21\u65b9\u3092\u6e80\u305f\u3059\u5024\uff08\u8ad6\u7406\u6f14\u7b97\u5b50 AND\uff09\u3092\u62bd\u51fa\uff08\u65e2\u5b9a\u5024\uff09<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlOr<\/td>\n<td width=\"80\" align = \"center\">2<\/td>\n<td width=\"320\">\u62bd\u51fa\u6761\u4ef6 1 \u307e\u305f\u306f \u62bd\u51fa\u6761\u4ef6 2 \u306e\u3044\u305a\u308c\u304b\u3092\u6e80\u305f\u3059\u5024\uff08\u8ad6\u7406\u6f14\u7b97\u5b50 OR\uff09\u3092\u62bd\u51fa<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlTop10Items<\/td>\n<td width=\"80\" align = \"center\">3<\/td>\n<td width=\"320\">\u4e0a\u4f4d [\u62bd\u51fa\u6761\u4ef6 1 \u3067\u6307\u5b9a\u3055\u308c\u308b\u6570] \u306e\u30ec\u30b3\u30fc\u30c9\u3092\u62bd\u51fa<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlBottom10Items<\/td>\n<td width=\"80\" align = \"center\">4<\/td>\n<td width=\"320\">\u4e0b\u4f4d [\u62bd\u51fa\u6761\u4ef6 1 \u3067\u6307\u5b9a\u3055\u308c\u308b\u6570] \u306e\u30ec\u30b3\u30fc\u30c9\u3092\u62bd\u51fa<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlTop10Percent<\/td>\n<td width=\"80\" align = \"center\">5<\/td>\n<td width=\"320\">\u4e0a\u4f4d [\u62bd\u51fa\u6761\u4ef6 1 \u3067\u6307\u5b9a\u3055\u308c\u308b\u5272\u5408(%)] \u306e\u5024\u3092\u3082\u3064\u30ec\u30b3\u30fc\u30c9\u3092\u62bd\u51fa<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlBottom10Percent<\/td>\n<td width=\"80\" align = \"center\">6<\/td>\n<td width=\"320\">\u4e0b\u4f4d [\u62bd\u51fa\u6761\u4ef6 1 \u3067\u6307\u5b9a\u3055\u308c\u308b\u5272\u5408(%)] \u306e\u5024\u3092\u3082\u3064\u30ec\u30b3\u30fc\u30c9\u3092\u62bd\u51fa<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlFilterValues<\/td>\n<td width=\"80\" align = \"center\">7<\/td>\n<td width=\"320\">\u5024\uff08\u8907\u6570\u306e\u5024\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u62bd\u51fa\u6761\u4ef6 1 \u306b\u914d\u5217\u3092\u6307\u5b9a\u3057\u307e\u3059\uff09 <\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlFilterCellColor<\/td>\n<td width=\"80\" align = \"center\">8<\/td>\n<td width=\"320\">\u30bb\u30eb\u306e\u8272<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlFilterFontColor<\/td>\n<td width=\"80\" align = \"center\">9<\/td>\n<td width=\"320\">\u30d5\u30a9\u30f3\u30c8\u306e\u8272<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlFilterIcon<\/td>\n<td width=\"80\" align = \"center\">10<\/td>\n<td width=\"320\">\u30a2\u30a4\u30b3\u30f3<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">xlFilterDynamic<\/td>\n<td width=\"80\" align = \"center\">11<\/td>\n<td width=\"320\">\u52d5\u7684\u30d5\u30a3\u30eb\u30bf\u30fc\uff08\u62bd\u51fa\u6761\u4ef6 1 \u306b\u3001<strong>XlDynamicFilterCriteria \u5217\u6319\u578b<\/strong> \u306e\u5b9a\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\uff09<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<li>criteria2&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\uff12\u756a\u76ee\u306e\u62bd\u51fa\u6761\u4ef6\u3068\u306a\u308b\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5f15\u6570 <em>Criteria1<\/em> \u304a\u3088\u3073\u5f15\u6570 <em>Operator<\/em> \u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3044\u3001\u8907\u5408\u62bd\u51fa\u6761\u4ef6\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u62bd\u51fa\u6761\u4ef6 2 \uff09<\/li>\n<li>visibledropdown&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<strong>True<\/strong> \u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u5f15\u6570 <em>field<\/em> \u3067\u6307\u5b9a\u3057\u305f\u5217\uff08\u30d5\u30a3\u30fc\u30eb\u30c9\uff09\u306e\u30aa\u30fc\u30c8\u30d5\u30a3\u30eb\u30bf\u30fc\u306e\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u77e2\u5370\u3092\u8868\u793a\u3057\u3001<strong>False<\/strong> \u3092\u6307\u5b9a\u3059\u308b\u3068\u975e\u8868\u793a\u306b\u3057\u307e\u3059\u3002\u65e2\u5b9a\u5024\u306f <strong>True<\/strong> \u3067\u3059\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution8\">xlFilterValues\u3001xlFilterCellColor\u3001xlFilterIcon\u3001xlFilterFontColor\u3001xlFilterDynamic \u306f\u3001Excel 2007 \u4ee5\u964d<\/p>\n<\/p><\/div>\n<\/div>\n<br \/><br \/>\n<h2>AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b 1<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b 1\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample02_AutoFilter()\r\n\r\n    \r\n    With ActiveSheet.Range(\"$B$3:$J$26\")\r\n    \r\n        '\u300c\u5408\u8a08\u300d\u4e0a\u4f4d10\u30ec\u30b3\u30fc\u30c9\u3092\u62bd\u51fa\r\n        .AutoFilter Field:=8, _\r\n                    Criteria1:=12, _\r\n                    Operator:=xlTop10Items\r\n                    \r\n        '\u300c\u6c0f\u540d\u300d\u300c\u7530\u300d\u304c\u3064\u304f\u30ec\u30b3\u30fc\u30c9\u3092\u62bd\u51fa\r\n        .AutoFilter Field:=2, _\r\n                    Criteria1:=\"*\u7530*\"\r\n                    \r\n    End With\r\n    \r\n    \r\n    '\u300c\u5408\u8a08\u300d\u3092\u5bfe\u8c61\u306b\u3001\u964d\u9806\u3067\u4e26\u3079\u66ff\u3048\r\n    With ActiveWorkbook.Worksheets(\"Sheet1\").AutoFilter.Sort\r\n    \r\n        With .SortFields\r\n    \r\n            .Clear\r\n        \r\n            .Add Key:=Range(\"I3:I26\"), _\r\n                 SortOn:=xlSortOnValues, _\r\n                 Order:=xlDescending, _\r\n                 DataOption:=xlSortNormal\r\n        \r\n        End With\r\n             \r\n        .Header = xlYes\r\n        .MatchCase = False\r\n        .Orientation = xlTopToBottom\r\n        .SortMethod = xlPinYin\r\n        .Apply\r\n    \r\n\r\n    End With\r\n    \r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_01.jpg?ssl=1\" rel=\"lightbox[3500]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_01.jpg?resize=580%2C352&#038;ssl=1\" alt=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\uff12_1\" width=\"580\" height=\"352\" class=\"alignnone size-large wp-image-3504\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_01.jpg?resize=580%2C352&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_01.jpg?resize=400%2C243&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_01.jpg?w=899&amp;ssl=1 899w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_02a.jpg?ssl=1\" rel=\"lightbox[3500]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_02a.jpg?resize=580%2C354&#038;ssl=1\" alt=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\uff12_2\" width=\"580\" height=\"354\" class=\"alignnone size-large wp-image-3508\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_02a.jpg?resize=580%2C354&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_02a.jpg?resize=400%2C244&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_02a.jpg?w=899&amp;ssl=1 899w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b 2<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b 2\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample02_2_AutoFilter()\r\n\r\n    With ActiveSheet.Range(\"$B$3:$J$26\")\r\n    \r\n        '\u300c\u767b\u9332\u756a\u53f7\u300d1001,1002,1003,1004,1005 \u3092\u62bd\u51fa\r\n        '\uff11\u3064\u306e\u5217\u3067\uff13\u3064\u4ee5\u4e0a\u306e\u6761\u4ef6\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\r\n        '\u300coperator\u300d\u306b\u300cxlFilterValues\u300d\u3092\u6307\u5b9a\u3057\u307e\u3059\r\n        .AutoFilter Field:=1, _\r\n                    criteria1:=Array(\"1001\", \"1002\", \"1003\", \"1004\", \"1005\"), _\r\n                    Operator:=xlFilterValues\r\n\r\n    End With\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_03.jpg?ssl=1\" rel=\"lightbox[3500]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_03.jpg?resize=580%2C366&#038;ssl=1\" alt=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\uff12_3\" width=\"580\" height=\"366\" class=\"alignnone size-large wp-image-3574\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_03.jpg?resize=580%2C366&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_03.jpg?resize=400%2C252&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_03.jpg?w=898&amp;ssl=1 898w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_04.jpg?ssl=1\" rel=\"lightbox[3500]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_04.jpg?resize=580%2C366&#038;ssl=1\" alt=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\uff12_4\" width=\"580\" height=\"366\" class=\"alignnone size-large wp-image-3575\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_04.jpg?resize=580%2C366&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_04.jpg?resize=400%2C252&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_04.jpg?w=899&amp;ssl=1 899w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>AutoFilter \u30e1\u30bd\u30c3\u30c9 \u3010\u66f8\u5f0f\u3011 object.AutoFilter ( &#8230; <\/p>\n","protected":false},"author":1,"featured_media":3592,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[268],"tags":[546,270,63,38,269],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter02_01-580x3521.jpg?fit=580%2C352&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-Us","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3500"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=3500"}],"version-history":[{"count":13,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3500\/revisions"}],"predecessor-version":[{"id":3593,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3500\/revisions\/3593"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/3592"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=3500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=3500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=3500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}