{"id":5712,"date":"2016-10-06T16:15:08","date_gmt":"2016-10-06T07:15:08","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5712"},"modified":"2016-10-06T16:15:08","modified_gmt":"2016-10-06T07:15:08","slug":"listobjectsort","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/listobjectsort\/","title":{"rendered":"\u30ea\u30b9\u30c8\u30fb\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u3079\u66ff\u3048\uff08Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8,Sort \u30d7\u30ed\u30d1\u30c6\u30a3\uff09"},"content":{"rendered":"<h2>\u30ea\u30b9\u30c8\u30fb\u30c6\u30fc\u30d6\u30eb\u3092\u4e26\u3079\u66ff\u3048\u308b<\/h2>\n<div class=\"m30-l\">\n<p>\u30c6\u30fc\u30d6\u30eb\uff08\u30ea\u30b9\u30c8\uff09\u3092\u4e26\u3079\u66ff\u3048\u308b\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    <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 \/><br \/>\n<h2>\u30ea\u30b9\u30c8\u30fb\u30c6\u30fc\u30d6\u30eb\u306e\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<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"\u4e26\u3079\u66ff\u3048 Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ListObject_Sort01()\r\n'Sort\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u3063\u3066\u4e26\u3079\u66ff\u3048\uff08Excel 2007 \u4ee5\u964d\uff09\r\n\r\n    Sheets(\"Sheet5\").Activate\r\n    \r\n    Dim mysheet As Worksheet\r\n    Dim mytbl As ListObject\r\n    \r\n    Set mysheet = ActiveWorkbook.ActiveSheet\r\n    \r\n    On Error GoTo ErrH\r\n    \r\n    Set mytbl = mysheet.ListObjects(\"\u6210\u7e3e\u886803\")\r\n    \r\n    '\u4e26\u3079\u66ff\u3048\uff08\u5408\u8a08\u5024\u3001\u964d\u9806\uff09\r\n    With mytbl.Sort\r\n    \r\n        With .SortFields\r\n        \r\n        .Clear\r\n        \r\n        .Add Key:=Range(\"H1\"), _\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        .Orientation = xlTopToBottom\r\n        .Apply\r\n        \r\n    End With\r\n    \r\n    Exit Sub\r\n    \r\nErrH:\r\n    MsgBox \"\u4e26\u3079\u66ff\u3048\u3092\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\"\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\/2016\/08\/listobject_sort_object_01.jpg?ssl=1\" rel=\"lightbox[5712]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_01.jpg?resize=580%2C360&#038;ssl=1\" alt=\"ListObject Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 01\" width=\"580\" height=\"360\" class=\"alignnone size-large wp-image-5713\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_01.jpg?resize=580%2C360&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_01.jpg?resize=400%2C248&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_01.jpg?w=684&amp;ssl=1 684w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 \u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_02.jpg?ssl=1\" rel=\"lightbox[5712]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_02.jpg?resize=580%2C359&#038;ssl=1\" alt=\"ListObject Sort \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 02\" width=\"580\" height=\"359\" class=\"alignnone size-large wp-image-5714\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_02.jpg?resize=580%2C359&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_02.jpg?resize=400%2C248&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_object_02.jpg?w=685&amp;ssl=1 685w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>\u30ea\u30b9\u30c8\u30fb\u30c6\u30fc\u30d6\u30eb\u306e\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<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"\u4e26\u3079\u66ff\u3048 Sort \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ListObject_Sort02()\r\n'Sort\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u4e26\u3079\u66ff\u3048\r\n\r\n    Sheets(\"Sheet5\").Activate\r\n    \r\n    Dim mysheet As Worksheet\r\n    Dim mytbl As ListObject\r\n    Set mysheet = ActiveWorkbook.ActiveSheet\r\n    \r\n    On Error GoTo ErrH\r\n    \r\n    Set mytbl = mysheet.ListObjects(\"\u6210\u7e3e\u886803\")\r\n    \r\n    '\u4e26\u3079\u66ff\u3048\uff08\u540d\u524d\u3001\u6607\u9806\uff09\r\n    mytbl.Range.Sort key1:=Range(\"A1\"), _\r\n                         order1:=xlAscending, _\r\n                         Header:=xlYes, _\r\n                         Orientation:=xlTopToBottom, _\r\n                         SortMethod:=xlPinYin\r\n    Exit Sub\r\n    \r\nErrH:\r\n    MsgBox \"\u4e26\u3079\u66ff\u3048\u3092\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\"\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\/2016\/08\/listobject_sort_method_01.jpg?ssl=1\" rel=\"lightbox[5712]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_01.jpg?resize=580%2C360&#038;ssl=1\" alt=\"ListObject Sort \u30e1\u30bd\u30c3\u30c9 01\" width=\"580\" height=\"360\" class=\"alignnone size-large wp-image-5715\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_01.jpg?resize=580%2C360&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_01.jpg?resize=400%2C248&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_01.jpg?w=686&amp;ssl=1 686w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 \u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_02.jpg?ssl=1\" rel=\"lightbox[5712]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_02.jpg?resize=580%2C361&#038;ssl=1\" alt=\"ListObject Sort \u30e1\u30bd\u30c3\u30c9 02\" width=\"580\" height=\"361\" class=\"alignnone size-large wp-image-5716\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_02.jpg?resize=580%2C361&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_02.jpg?resize=400%2C249&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/08\/listobject_sort_method_02.jpg?w=683&amp;ssl=1 683w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>\u30ea\u30b9\u30c8\u30fb\u30c6\u30fc\u30d6\u30eb\u3092\u4e26\u3079\u66ff\u3048\u308b \u30c6\u30fc\u30d6\u30eb\uff08\u30ea\u30b9\u30c8\uff09\u3092\u4e26\u3079\u66ff\u3048\u308b\u306b\u306f\u3001Sort \u30e1\u30bd &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5888,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[907],"tags":[914,527,525,63,38,908],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/10\/listobject_sort_object_01-580x360.jpg?fit=580%2C360&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1u8","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5712"}],"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=5712"}],"version-history":[{"count":2,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5712\/revisions"}],"predecessor-version":[{"id":5887,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5712\/revisions\/5887"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5888"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}