{"id":1688,"date":"2015-05-01T12:17:17","date_gmt":"2015-05-01T03:17:17","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=1688"},"modified":"2015-05-01T12:17:17","modified_gmt":"2015-05-01T03:17:17","slug":"typestatement","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/typestatement\/","title":{"rendered":"\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u5909\u6570\u3092\u4f7f\u3046\uff08Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\uff09"},"content":{"rendered":"<h2>Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u3046<\/h2>\n<br \/>\n<div class=\"m30-l\">\n<p><strong>Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\u3092\u4f7f\u3046\u3068\uff11\u3064\u307e\u305f\u306f\u8907\u6570\u306e\u8981\u7d20\u3092<strong>\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b<\/strong>\u3068\u3057\u3066\uff11\u3064\u306b\u307e\u3068\u3081\u3066\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u69cb\u6587\u3011<\/strong><\/p>\n<p>  [ <strong>Private<\/strong> | <strong>Public<\/strong> ] <strong>Type<\/strong> <em>varname<\/em><\/p>\n<p>\u3000\u3000<em>element<\/em> <strong>As<\/strong> <em>element_type<\/em><\/p>\n<p>  \u3000\u3000[ \u2026\u2026 ]<\/p>\n<p><strong>End Type<\/strong><\/p>\n<\/div>\n<br \/>\n<h3>\u3010\u9805\u76ee\u306e\u8aac\u660e\u3011<\/h3>\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>varname&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5ba3\u8a00\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u306e\u540d\u524d<\/li>\n<li>element&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u306e\u8981\u7d20\u540d<\/li>\n<li>element_type&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u306e\u8981\u7d20 <em>element<\/em> \u306e\u30c7\u30fc\u30bf\u578b<\/li>\n<li>[ \u2026\u2026 ]&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u8981\u7d20\u304c\u8907\u6570\u3042\u308b\u5834\u5408\u3001<em>element<\/em>,<em>element_type<\/em>\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\"><strong>Public<\/strong> \u3092\u6307\u5b9a\u3059\u308b\u3068\u3059\u3079\u3066\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u3069\u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u304b\u3089\u3082\u53c2\u7167\u3067\u304d\u307e\u3059\u3002\u4e00\u65b9\u3001<strong>Private<\/strong> \u3092\u6307\u5b9a\u3059\u308b\u3068\u5ba3\u8a00\u304c\u884c\u308f\u308c\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u3067\u3057\u304b\u53c2\u7167\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002\n<\/p>\n<p class=\"caution4\">\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u306e\u5909\u6570\u3092\u5ba3\u8a00\u3057\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u305d\u306e\u5909\u6570\u540d\u306e\u5f8c\u306b\u30d4\u30ea\u30aa\u30c9(.)\u3092\u5165\u529b\u3059\u308b\u3068\u305d\u306e<strong>\u8981\u7d20\u540d\u306e\u30ea\u30b9\u30c8<\/strong>\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\n<\/p>\n<p class=\"caution4\">\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u306e\u914d\u5217\u306b\u5bfe\u3057\u3066\u306f\u3001<strong>For Each &#8230; Next<\/strong> \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u914d\u5217\u8981\u7d20\u306e\u7e70\u308a\u8fd4\u3057\u306b\u306f\u3001\u901a\u5e38\u306e <strong>For &#8230; Next<\/strong> \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><span class=\"red\"><\/span><\/p>\n<\/div>\n<br \/>\n<h2>Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\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=\"Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\r\n\u3000\r\n'--------------------------------------------------------------------\r\n' \u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\r\n'--------------------------------------------------------------------\r\nType myAddress\r\n\r\n    ID As Integer\r\n    Namae As String\r\n    Birthday As Date\r\n    Syumi As Variant\r\n\r\nEnd Type\r\n'--------------------------------------------------------------------\r\n' \u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u5909\u6570\u3092\u4f7f\u3046\r\n'--------------------------------------------------------------------\r\nSub Sample()\r\n\r\n    Dim myData(1 To 5) As myAddress\r\n    Dim i As Long, str As String\r\n    \r\n    With ActiveWorkbook.Worksheets(\"Sheet1\")\r\n    \r\n        For i = 1 To 5\r\n            \r\n            myData(i).ID = .Cells(i + 1, 1).Value\r\n            myData(i).Namae = .Cells(i + 1, 2).Value\r\n            myData(i).Birthday = .Cells(i + 1, 3).Value\r\n            myData(i).Syumi = Split(.Cells(i + 1, 4).Value, \"\u3001\")\r\n            \r\n        Next i\r\n        \r\n    End With\r\n\r\n    For i = 1 To 5\r\n        \r\n        str = str & \" \" & myData(i).ID\r\n        str = str & \" \" & myData(i).Namae\r\n        str = str & \" \" & myData(i).Birthday\r\n        str = str & \" \" & Join(myData(i).Syumi, \",\")\r\n        str = str & Chr(13)\r\n        \r\n    Next i\r\n\r\n    MsgBox str\r\n    \r\nEnd Sub\r\n\r\n\u3000\r\n\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/type_01.jpg?ssl=1\" rel=\"lightbox[1688]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/type_01.jpg?resize=400%2C313&#038;ssl=1\" alt=\"Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 \u4f8b\" width=\"400\" height=\"313\" class=\"alignnone size-medium wp-image-1691\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/type_01.jpg?resize=400%2C313&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/type_01.jpg?resize=580%2C454&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/type_01.jpg?w=619&amp;ssl=1 619w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u3046 Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u3046\u3068\uff11\u3064\u307e\u305f\u306f\u8907\u6570\u306e &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1695,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":"\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u5909\u6570\u3092\u4f7f\u3046\uff08Type \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\uff09"},"categories":[48],"tags":[181,38,180,49],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/type_01-400x3131.jpg?fit=400%2C313&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-re","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1688"}],"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=1688"}],"version-history":[{"count":5,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1688\/revisions"}],"predecessor-version":[{"id":1694,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1688\/revisions\/1694"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/1695"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=1688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=1688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=1688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}