{"id":6600,"date":"2018-02-25T15:48:34","date_gmt":"2018-02-25T06:48:34","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=6600"},"modified":"2018-02-25T15:51:57","modified_gmt":"2018-02-25T06:51:57","slug":"customlistsort","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/customlistsort\/","title":{"rendered":"\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u3092\u4f7f\u3063\u3066\u4e26\u3079\u66ff\u3048\u308b\uff08Sort\uff09"},"content":{"rendered":"<h2>VBA\u3067\u30ea\u30b9\u30c8\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u4e26\u3079\u66ff\u3048\u308b\uff08Sort\uff09<\/h2>\n<div class=\"m30-l\">\n<p>VBA\u3067\u3001\u30bd\u30fc\u30c8\u3092\u884c\u3046\u306b\u306f\u3001<strong>Sort \u30e1\u30bd\u30c3\u30c9<\/strong>\uff08Excel 2003 \u4ee5\u964d\uff09\u3084 <strong>Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\uff08Excel 2007 \u4ee5\u964d\uff09\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n    \u7d44\u307f\u8fbc\u307f\u306e\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u3084\u72ec\u81ea\u306b\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u3092\u4f7f\u3063\u3066\u30bd\u30fc\u30c8\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001<strong>Sort \u30e1\u30bd\u30c3\u30c9<\/strong> \u306e\u5834\u5408\u306f\u3001\u5f15\u6570 <em>ordercustom<\/em> \u306b\u300c\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u300d\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306e\u4e0a\u304b\u3089\u306e\u9806\u756a\u3092\u6570\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<strong>Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u306e\u5834\u5408\u306f\u3001<strong>SortFields.Add \u30e1\u30bd\u30c3\u30c9<\/strong> \u3067\u3001\u5f15\u6570 <em>customorder<\/em> \u306b\u3001\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u4e26\u3079\u66ff\u3048\u306e\u9806\u756a\u3092<strong>\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u6587\u5b57\u5217<\/strong>\u3067\u6307\u5b9a\u3059\u308b\u304b\u3001\u300c\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u300d\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306e\u4e0a\u304b\u3089\u306e\u9806\u756a\u3092\u6570\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p class=\"caution8\"><strong>Sort \u30e1\u30bd\u30c3\u30c9<\/strong> \u306e\u5f15\u6570 <em>ordercustom<\/em> \u306b\u306f\u3001\u76f4\u63a5\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u3066\u3001\u4e26\u3079\u66ff\u3048\u306e\u57fa\u6e96\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u307e\u305a\u3001<strong>\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8<\/strong>\u306b\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution4\"><strong>Sort \u30e1\u30bd\u30c3\u30c9<\/strong> \u306b\u95a2\u3057\u3066\u306e\u8a73\u7d30\u306f <a href=\"https:\/\/excelwork.info\/excel\/cellsortmethod\/\">\u4e26\u3079\u66ff\u3048\uff08Sort \u30e1\u30bd\u30c3\u30c9\uff09<\/a>\u3001<strong>Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u306b\u95a2\u3057\u3066\u306e\u8a73\u7d30\u306f <a href=\"https:\/\/excelwork.info\/excel\/cellsortcollection\/\">\u4e26\u3079\u66ff\u3048\uff08Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8, SortFields \u30b3\u30ec\u30af\u30b7\u30e7\u30f3\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<br \/>\n<h2>Sort \u30e1\u30bd\u30c3\u30c9\uff08Excel 2003 \u4ee5\u964d\uff09<\/h2>\n<div class=\"m30-l\">\n  <br \/><\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u300c\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u300d\u3092\u4f7f\u7528\u3057\u3066\u4e26\u3079\u66ff\u3048\uff1e<\/strong><\/span><br \/>\n    <em>object1<\/em>.<strong>Sort<\/strong> ([ <em>key1, order1, header, ordercustom, matchcase, orientation, sortmethod, dataoption1<\/em> ] )<\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u300c\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u300d\u306b\u767b\u9332\uff1e<\/strong><\/span><br \/>\n    <em>object2<\/em>.<strong>AddCustomList<\/strong>( <em>listarray<\/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>object1&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>key1&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4e26\u3079\u66ff\u3048\u30ad\u30fc\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092 Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u30bb\u30eb\uff09\u3001\u307e\u305f\u306f\u6587\u5b57\u5217\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>order1&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;key1 \u3067\u6307\u5b9a\u3057\u305f\u5024\u306e\u4e26\u3073\u66ff\u3048\u9806\u5e8f\u3092 XlSortOrder \u5217\u6319\u578b \u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\t<em>xlAscending<\/em>\u3000\u2026\u3000\u6607\u9806\u3067\u4e26\u3079\u66ff\u3048\uff08\u65e2\u5b9a\u5024\uff09<br \/>\n\t<em>xlDescending<\/em>\u3000\u2026\u3000\u964d\u9806\u3067\u4e26\u3079\u66ff\u3048<\/li>\n<li>header&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5148\u982d\u884c\u3092\u898b\u51fa\u3057\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\t<em>xlGuess<\/em>\u3000\u2026\u3000Excel \u304c\u81ea\u52d5\u7684\u306b\u8a2d\u5b9a<br \/>\n\t<em>xlYes<\/em>\u3000\u2026\u3000\u898b\u51fa\u3057\u3068\u3057\u3066\u4f7f\u7528<br \/>\n\t<em>xlNo<\/em>\u3000\u2026\u3000\u898b\u51fa\u3057\u3068\u3057\u3066\u4f7f\u7528\u3057\u306a\u3044\uff08\u65e2\u5b9a\u5024\uff09<\/li>\n<li>ordercustom&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u306e\u4e26\u3079\u66ff\u3048\u9806\u306e\u30ea\u30b9\u30c8\u5185\u306e\u756a\u53f7\u3092\u793a\u3059\u30011 \u304b\u3089\u59cb\u307e\u308b\u6574\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>orientation&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4e26\u3079\u66ff\u3048\u306e\u65b9\u5411\u3092 XlSortOrientation \u5217\u6319\u578b \u3067\u6307\u5b9a\u3002<br \/>\n\t<em>xlSortColumns<\/em>\u3000\u2026\u3000\u884c\u5358\u4f4d\u3067\u4e26\u3079\u66ff\u3048\uff08\u4e0a\u304b\u3089\u4e0b\uff09\u65e2\u5b9a\u5024<br \/>\n\t<em>xlSortRows<\/em>\u3000\u2026\u3000\u5217\u5358\u4f4d\u3067\u4e26\u3079\u66ff\u3048\uff08\u5de6\u304b\u3089\u53f3\uff09<\/li>\n<li>sortmethod&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4e26\u3079\u66ff\u3048\u306e\u65b9\u6cd5\u3092 XlSortMethod \u5217\u6319\u578b \u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\t<em>xlPinYin<\/em>\u3000\u2026\u3000\u3075\u308a\u304c\u306a\u3092\u4f7f\u3063\u3066\u4e26\u3079\u66ff\u3048\uff08\u65e2\u5b9a\u5024\uff09<br \/>\n\t<em>xlStroke<\/em>\u3000\u2026\u3000\u3075\u308a\u304c\u306a\u3092\u4f7f\u308f\u305a\u306b\u4e26\u3079\u66ff\u3048<\/li>\n<li>DataOption1&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;Key1 \u3067\u6307\u5b9a\u3057\u305f\u7bc4\u56f2\u3067\u30c6\u30ad\u30b9\u30c8\u3092\u4e26\u3079\u66ff\u3048\u308b\u65b9\u6cd5\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\t<em>xlSortNormal<\/em>\u3000\u2026\u3000\u6570\u5024\u3068\u30c6\u30ad\u30b9\u30c8\u3092\u5225\u3005\u306b\u4e26\u3079\u66ff\u3048\uff08\u65e2\u5b9a\u5024\uff09<br \/>\n\t<em>xlSortTextAsNumbers<\/em>\u3000\u2026\u3000\u30c6\u30ad\u30b9\u30c8\u3092\u6570\u5024\u30c7\u30fc\u30bf\u3068\u3057\u3066\u4e26\u3079\u66ff\u3048<\/li>\n<li>object2&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>listarray&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u306b\u767b\u9332\u3059\u308b\u6587\u5b57\u5217\u306e\u914d\u5217\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\t\uff08\u4f8b\uff09<br \/>\n\tApplication.AddCustomList ListArray:= Array(&#8220;\u65e5&#8221;,&#8221;\u6708&#8221;,&#8221;\u706b&#8221;,&#8221;\u6c34&#8221;,&#8221;\u6728&#8221;,&#8221;\u91d1&#8221;,&#8221;\u571f&#8221;)\n      <\/li>\n<\/ul>\n<br \/><\/div>\n<\/div>\n<br \/><br \/>\n<h2>\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u3092\u4f7f\u3063\u3066\u4e26\u3079\u66ff\u3048\uff08Sort \u30e1\u30bd\u30c3\u30c9\uff09\u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff11<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"Sort \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_SortMethod()\r\n\r\n    Dim myRng As Worksheet\r\n    Set myRng = ActiveWorkbook.Worksheets(\"\u58f2\u4e0a\")\r\n    \r\n    With myRng.Range(\"A1\").CurrentRegion\r\n    \r\n        '\u300c\u30d5\u30ea\u30ac\u30ca\u300d\u3092\u30a4\u30ed\u30cf\u9806\u3067\u4e26\u3079\u66ff\u3048\uff08\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u4f7f\u7528\uff09\r\n        .Sort key1:=Range(\"H1\"), _\r\n            order1:=xlAscending, _\r\n            Header:=xlYes, _\r\n            ordercustom:=13, _\r\n            MatchCase:=False, _\r\n            Orientation:=xlSortColumns, _\r\n            SortMethod:=xlStroke\r\n        \r\n        '\u300c\u56db\u534a\u671f\u300d\u3092\u4e26\u3079\u66ff\u3048\r\n        .Sort key1:=Range(\"E1\"), _\r\n            order1:=xlAscending, _\r\n            Header:=xlYes, _\r\n            ordercustom:=9, _\r\n            MatchCase:=False, _\r\n            Orientation:=xlSortColumns, _\r\n            SortMethod:=xlStroke\r\n        \r\n        '\u300c\u671f\u300d\u3092\u6607\u9806\u3067\u4e26\u3079\u66ff\u3048\r\n        .Sort key1:=Range(\"B1\"), _\r\n            order1:=xlAscending, _\r\n            Header:=xlYes, _\r\n            MatchCase:=False, _\r\n            Orientation:=xlSortColumns, _\r\n            SortMethod:=xlStroke\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>\u73fe\u5728\u306e\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlist01.jpg?ssl=1\" rel=\"lightbox[6600]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlist01.jpg?resize=572%2C441&#038;ssl=1\" alt=\"\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\" width=\"572\" height=\"441\" class=\"alignnone size-full wp-image-6602\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlist01.jpg?w=572&amp;ssl=1 572w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlist01.jpg?resize=400%2C308&amp;ssl=1 400w\" sizes=\"(max-width: 572px) 100vw, 572px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff11 \u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod1.jpg?ssl=1\" rel=\"lightbox[6600]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod1.jpg?resize=580%2C367&#038;ssl=1\" alt=\"Sort \u30e1\u30bd\u30c3\u30c9\uff08\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\uff09\uff11\" width=\"580\" height=\"367\" class=\"alignnone size-large wp-image-6604\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod1.jpg?resize=580%2C367&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod1.jpg?resize=400%2C253&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod1.jpg?resize=768%2C486&amp;ssl=1 768w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod1.jpg?w=982&amp;ssl=1 982w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff11 \u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod2.jpg?ssl=1\" rel=\"lightbox[6600]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod2.jpg?resize=580%2C369&#038;ssl=1\" alt=\"Sort \u30e1\u30bd\u30c3\u30c9\uff08\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\uff09\uff12\" width=\"580\" height=\"369\" class=\"alignnone size-large wp-image-6605\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod2.jpg?resize=580%2C369&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod2.jpg?resize=400%2C254&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod2.jpg?resize=768%2C488&amp;ssl=1 768w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortmethod2.jpg?w=982&amp;ssl=1 982w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08Excel 2007 \u4ee5\u964d\uff09<\/h2>\n<div class=\"m30-l\">\n  <br \/><\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1cSortFields.Add \u30e1\u30bd\u30c3\u30c9\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>SortFields<\/strong>( <em>key<\/em> [, <em>sorton<\/em>, <em>order<\/em>, <em>customorder<\/em>, <em>dataoption<\/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>Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>key&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4e26\u3079\u66ff\u3048\u306e\u30ad\u30fc\u5024\u3092\u30bb\u30eb\u7bc4\u56f2\uff08Range \u578b\uff09\u3067\u3001 \u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>sorton&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4e26\u3079\u66ff\u3048\u306e\u5bfe\u8c61\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\t<em>xlSortOnCellColor<\/em>\u3000\u2026\u3000\u30bb\u30eb\u306e\u8272<br \/>\n\t<em>xlSortOnFontColor<\/em>\u3000\u2026\u3000\u30d5\u30a9\u30f3\u30c8\u306e\u8272<br \/>\n\t<em>xlSortOnIcon<\/em>\u3000\u2026\u3000\u30a2\u30a4\u30b3\u30f3<br \/>\n\t<em>xlSortOnValues<\/em>\u3000\u2026\u3000\u5024<\/li>\n<li>order&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4e26\u3073\u66ff\u3048\u9806\u5e8f\u3092 XlSortOrder \u5217\u6319\u578b \u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\t<em>xlAscending<\/em>\u3000\u2026\u3000\u6607\u9806\u3067\u4e26\u3079\u66ff\u3048\uff08\u65e2\u5b9a\u5024\uff09<br \/>\n\t<em>xlDescending<\/em>\u3000\u2026\u3000\u964d\u9806\u3067\u4e26\u3079\u66ff\u3048<\/li>\n<li>customorder&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<br \/>\n\t\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u4e26\u3079\u66ff\u3048\u306e\u9806\u756a\u3092<strong>\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u6587\u5b57\u5217<\/strong>\uff08Variant\uff09\u3067\u6307\u5b9a\u3059\u308b\u304b\u3001\u300c\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u300d\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306e\u4e0a\u304b\u3089\u306e\u9806\u756a\u3092\u6570\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>dataoption&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30c6\u30ad\u30b9\u30c8\u3092\u4e26\u3079\u66ff\u3048\u308b\u65b9\u6cd5\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\t<em>xlSortNormal<\/em>\u3000\u2026\u3000\u6570\u5024\u3068\u30c6\u30ad\u30b9\u30c8\u3092\u5225\u3005\u306b\u4e26\u3079\u66ff\u3048\uff08\u65e2\u5b9a\u5024\uff09<br \/>\n\t<em>xlSortTextAsNumbers<\/em>\u3000\u2026\u3000\u30c6\u30ad\u30b9\u30c8\u3092\u6570\u5024\u30c7\u30fc\u30bf\u3068\u3057\u3066\u4e26\u3079\u66ff\u3048<\/li>\n<\/ul>\n<br \/><\/div>\n<\/div>\n<br \/><br \/>\n<h2>\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u3092\u4f7f\u3063\u3066\u4e26\u3079\u66ff\u3048\uff08Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff12<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_SortObject()\r\n \r\n    Dim myRng As Worksheet\r\n    Set myRng = ActiveWorkbook.Worksheets(\"\u58f2\u4e0a\")\r\n \r\n    With myRng.Sort\r\n    \r\n        With .SortFields\r\n            .Clear\r\n            '\u300c\u671f\u300d\u3092\u6607\u9806\u3067\u4e26\u3079\u66ff\u3048\r\n            .Add Key:=Range(\"B1\"), _\r\n                 SortOn:=xlSortOnValues, _\r\n                 Order:=xlAscending, _\r\n                 DataOption:=xlSortNormal\r\n                 \r\n            '\u300c\u56db\u534a\u671f\u300d\u3092\u4e26\u3079\u66ff\u3048\uff08\u6587\u5b57\u5217\u3092\u6307\u5b9a\uff09\r\n            .Add Key:=Range(\"E1\"), _\r\n                 SortOn:=xlSortOnValues, _\r\n                 Order:=xlAscending, _\r\n                 CustomOrder:=\"\u7b2c1\u56db\u534a\u671f,\u7b2c2\u56db\u534a\u671f,\u7b2c3\u56db\u534a\u671f,\u7b2c4\u56db\u534a\u671f\", _\r\n                 DataOption:=xlSortNormal\r\n                 \r\n            '\u300c\u30d5\u30ea\u30ac\u30ca\u300d\u3092\u30a4\u30ed\u30cf\u9806\u3067\u4e26\u3079\u66ff\u3048\uff08\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\u4f7f\u7528\uff09\r\n            .Add Key:=Range(\"H1\"), _\r\n                 SortOn:=xlSortOnValues, _\r\n                 Order:=xlAscending, _\r\n                 CustomOrder:=12, _\r\n                 DataOption:=xlSortNormal\r\n                 \r\n        End With\r\n            \r\n        .SetRange Range(\"A1\").CurrentRegion     '\u4e26\u3079\u66ff\u3048\u7bc4\u56f2\u3092\u8a2d\u5b9a\r\n        .Header = xlYes                         '\u5148\u982d\u884c\u3092\u898b\u51fa\u3057\u3068\u3057\u3066\u4f7f\u7528\r\n        .MatchCase = False                      '\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\r\n        .Orientation = xlTopToBottom            '\u884c\u5358\u4f4d\u3067\u4e26\u3079\u66ff\u3048\r\n        .SortMethod = xlStroke                  '\u3075\u308a\u304c\u306a\u3092\u4f7f\u308f\u306a\u3044\r\n        .Apply                                  '\u4e26\u3079\u66ff\u3048\u3092\u5b9f\u884c\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\uff12 \u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject1.jpg?ssl=1\" rel=\"lightbox[6600]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject1.jpg?resize=580%2C367&#038;ssl=1\" alt=\"Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\uff09\uff11\" width=\"580\" height=\"367\" class=\"alignnone size-large wp-image-6606\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject1.jpg?resize=580%2C367&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject1.jpg?resize=400%2C253&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject1.jpg?resize=768%2C486&amp;ssl=1 768w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject1.jpg?w=982&amp;ssl=1 982w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff12 \u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject2.jpg?ssl=1\" rel=\"lightbox[6600]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject2.jpg?resize=580%2C367&#038;ssl=1\" alt=\"Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u30ea\u30b9\u30c8\uff09\uff12\" width=\"580\" height=\"367\" class=\"alignnone size-large wp-image-6607\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject2.jpg?resize=580%2C367&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject2.jpg?resize=400%2C253&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject2.jpg?resize=768%2C486&amp;ssl=1 768w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlistsort_sortobject2.jpg?w=982&amp;ssl=1 982w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>VBA\u3067\u30ea\u30b9\u30c8\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u4e26\u3079\u66ff\u3048\u308b\uff08Sort\uff09 VBA\u3067\u3001\u30bd\u30fc\u30c8\u3092\u884c\u3046\u306b\u306f\u3001S &#8230; <\/p>\n","protected":false},"author":1,"featured_media":6602,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[37],"tags":[954,1058,1057,526,1059],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2018\/02\/customlist01.jpg?fit=572%2C441&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1Is","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/6600"}],"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=6600"}],"version-history":[{"count":6,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/6600\/revisions"}],"predecessor-version":[{"id":6611,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/6600\/revisions\/6611"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/6602"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=6600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=6600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=6600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}