{"id":3677,"date":"2015-09-16T08:19:01","date_gmt":"2015-09-15T23:19:01","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=3677"},"modified":"2015-09-16T08:19:01","modified_gmt":"2015-09-15T23:19:01","slug":"rangeautofilter12","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/rangeautofilter12\/","title":{"rendered":"\u30aa\u30fc\u30c8\u30d5\u30a3\u30eb\u30bf\uff08\u62bd\u51fa\u4ef6\u6570\u306e\u53d6\u5f97\u30fb\u7d50\u679c\u96c6\u8a08\uff09AutoFilter \u30e1\u30bd\u30c3\u30c9"},"content":{"rendered":"<h2>\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u306e Subtotal \u95a2\u6570 \u306e\u4f7f\u3044\u65b9<\/h2>\n<div class=\"m30-l\">\n<p>VBA \u306b\u306f\u3001\u30aa\u30fc\u30c8\u30d5\u30a3\u30eb\u30bf\u306e\u62bd\u51fa\u4ef6\u6570\u3092\u53d6\u5f97\u3059\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3084\u30e1\u30bd\u30c3\u30c9\u304c\u306a\u3044\u305f\u3081\u3001\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u306e <strong>SABTOTAL \u95a2\u6570<\/strong> \u3092 <strong>WorksheetFunction \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u304b\u3089\u547c\u3073\u51fa\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002\u3055\u3089\u306b\u3001<strong>SABTOTAL \u95a2\u6570<\/strong> \u3092\u4f7f\u7528\u3057\u3066\u3001\u62bd\u51fa\u7d50\u679c\u3092\u5bfe\u8c61\u306b\u3055\u307e\u3056\u307e\u306a\u96c6\u8a08\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>WorksheetFunction<\/strong>.<strong>Subtotal<\/strong> ( <em>arg1<\/em>, <em>arg2<\/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>Application \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>arg1&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u96c6\u8a08\u65b9\u6cd5\u3092\u6574\u6570\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u7701\u7565\u4e0d\u53ef\uff09<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"100\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"150\" bgcolor=\"#ffffccc\"><strong>\u5bfe\u5fdc\u3059\u308b\u95a2\u6570<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">1<\/td>\n<td width=\"150\">AVERAGE<\/td>\n<td width=\"400\">\u5e73\u5747<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">2<\/td>\n<td width=\"150\">COUNT<\/td>\n<td width=\"400\">\u6570\u5024\u3092\u542b\u3080\u30bb\u30eb\u6570<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">3<\/td>\n<td width=\"150\">COUNTA<\/td>\n<td width=\"400\">\u7a7a\u767d\u3067\u306a\u3044\u30bb\u30eb\u6570<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">4<\/td>\n<td width=\"150\">MAX<\/td>\n<td width=\"400\">\u6700\u5927\u5024<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">5<\/td>\n<td width=\"150\">MIN<\/td>\n<td width=\"400\">\u6700\u5c0f\u5024<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">6<\/td>\n<td width=\"150\">PRODUCT<\/td>\n<td width=\"400\">\u7a4d<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">7<\/td>\n<td width=\"150\">STDEV<\/td>\n<td width=\"400\">\u6a19\u672c\u6a19\u6e96\u504f\u5dee<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">8<\/td>\n<td width=\"150\">STDEVP<\/td>\n<td width=\"400\">\u6a19\u6e96\u504f\u5dee<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">9<\/td>\n<td width=\"150\">SUM<\/td>\n<td width=\"400\">\u5408\u8a08<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">10<\/td>\n<td width=\"150\">VAR<\/td>\n<td width=\"400\">\u4e0d\u504f\u5206\u6563<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">11<\/td>\n<td width=\"150\">VARP<\/td>\n<td width=\"400\">\u6a19\u672c\u5206\u6563<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<li>arg2&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u96c6\u8a08\u5bfe\u8c61\u306e\u30bb\u30eb\u7bc4\u56f2\uff08Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u7701\u7565\u4e0d\u53ef\uff09<\/li>\n<\/ul>\n<br \/><\/div>\n<p class=\"caution4\"><strong>AutoFilter \u30e1\u30bd\u30c3\u30c9<\/strong> \u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/rangeautofilter2\/\">\u30aa\u30fc\u30c8\u30d5\u30a3\u30eb\u30bf\uff08AutoFilter \u30e1\u30bd\u30c3\u30c9\uff09<\/a> \u7b49\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>\u30aa\u30fc\u30c8\u30d5\u30a3\u30eb\u30bf\u306e\u7d50\u679c\u3092\u96c6\u8a08\u3059\u308b\u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\u3000\uff11<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"\u62bd\u51fa\u4ef6\u6570\u3092\u53d6\u5f97\u3059\u308b\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample12_1_AutoFilter()\r\n\r\n    Dim cnt As Long\r\n    \r\n    '\u62bd\u51fa\u6761\u4ef6\u300c\u5408\u8a08\u300d400\u70b9\u4ee5\u4e0a\r\n    Range(\"B3\").AutoFilter Field:=8, _\r\n                           criteria1:=\">=400\"\r\n                           \r\n    '\u62bd\u51fa\u4ef6\u6570\u3092\u53d6\u5f97\r\n    cnt = Application.WorksheetFunction.Subtotal _\r\n                (3, Range(\"B3\").CurrentRegion.Columns(1)) - 1\r\n    \r\n    MsgBox cnt\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\/autofilter12_01_1.jpg?ssl=1\" rel=\"lightbox[3677]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_1.jpg?resize=580%2C367&#038;ssl=1\" alt=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\uff11\uff12_\uff11\" width=\"580\" height=\"367\" class=\"alignnone size-large wp-image-3680\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_1.jpg?resize=580%2C367&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_1.jpg?resize=400%2C253&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_1.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\/autofilter12_01_2.jpg?ssl=1\" rel=\"lightbox[3677]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_2.jpg?resize=580%2C364&#038;ssl=1\" alt=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\uff11\uff12_\uff12\" width=\"580\" height=\"364\" class=\"alignnone size-large wp-image-3681\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_2.jpg?resize=580%2C364&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_2.jpg?resize=400%2C251&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_2.jpg?w=898&amp;ssl=1 898w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><br \/>\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\u3000\uff12<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"\u62bd\u51fa\u7d50\u679c\u3067\u96c6\u8a08\u3059\u308b\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample12_2_AutoFilter()\r\n\r\n    Dim myRng As Range\r\n    Dim Max_Total As Long, Min_Total As Long\r\n    Dim Ave_Math As Double, Total_Math As Long\r\n    \r\n    Set myRng = Range(\"B3:J24\")\r\n    \r\n    '\u62bd\u51fa\u6761\u4ef6\u300c\u767b\u9332\u756a\u53f7\u300d1010\u756a\u4ee5\u4e0b\r\n    myRng.AutoFilter Field:=1, _\r\n                     criteria1:=\"&lt;=1010\"\r\n    \r\n    \r\n    '8\u5217\uff08\u5408\u8a08\uff09\u306e\u6700\u9ad8\u70b9\u3092\u6c42\u3081\u308b\r\n    Max_Total = WorksheetFunction.Subtotal(4, myRng.Columns(8))\r\n    \r\n    '8\u5217\uff08\u5408\u8a08\uff09\u306e\u6700\u4f4e\u70b9\u3092\u6c42\u3081\u308b\r\n    Min_Total = WorksheetFunction.Subtotal(5, myRng.Columns(8))\r\n    \r\n    '6\u5217\uff08\u6570\u5b66\uff09\u306e\u5e73\u5747\u70b9\u3092\u6c42\u3081\u308b\r\n    Ave_Math = WorksheetFunction.Subtotal(1, myRng.Columns(6))\r\n                     \r\n    '6\u5217\uff08\u6570\u5b66\uff09\u306e\u5408\u8a08\u70b9\u3092\u6c42\u3081\u308b\r\n    Total_Math = WorksheetFunction.Subtotal(9, myRng.Columns(6))\r\n    \r\n    \r\n    MsgBox \"\u6700\u9ad8\u70b9\uff08\u5408\u8a08\uff09\uff1a\" & Max_Total & vbCrLf & _\r\n           \"\u6700\u4f4e\u70b9\uff08\u5408\u8a08\uff09\uff1a\" & Min_Total & vbCrLf & _\r\n           \"\u5e73\u5747\u70b9\uff08\u6570\u5b66\uff09\uff1a\" & Ave_Math & vbCrLf & _\r\n           \"\u5408\u8a08\u70b9\uff08\u6570\u5b66\uff09\uff1a\" & Total_Math\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:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_1.jpg?ssl=1\" rel=\"lightbox[3677]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_1.jpg?resize=580%2C367&#038;ssl=1\" alt=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\uff11\uff12_\uff13\" width=\"580\" height=\"367\" class=\"alignnone size-large wp-image-3682\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_1.jpg?resize=580%2C367&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_1.jpg?resize=400%2C253&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_1.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:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_2.jpg?ssl=1\" rel=\"lightbox[3677]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_2.jpg?resize=580%2C367&#038;ssl=1\" alt=\"AutoFilter \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\uff11\uff12_\uff14\" width=\"580\" height=\"367\" class=\"alignnone size-large wp-image-3683\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_2.jpg?resize=580%2C367&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_2.jpg?resize=400%2C253&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_02_2.jpg?w=898&amp;ssl=1 898w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u306e Subtotal \u95a2\u6570 \u306e\u4f7f\u3044\u65b9 VBA \u306b\u306f\u3001\u30aa\u30fc\u30c8\u30d5\u30a3\u30eb &#8230; <\/p>\n","protected":false},"author":1,"featured_media":3721,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[268],"tags":[546,270,553,63,38,269],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/autofilter12_01_1-580x3671.jpg?fit=580%2C367&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-Xj","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3677"}],"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=3677"}],"version-history":[{"count":5,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3677\/revisions"}],"predecessor-version":[{"id":3720,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3677\/revisions\/3720"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/3721"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=3677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=3677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=3677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}