{"id":398,"date":"2013-06-03T16:34:43","date_gmt":"2013-06-03T07:34:43","guid":{"rendered":"http:\/\/kassan.www2.jp\/?p=398"},"modified":"2015-11-11T14:37:59","modified_gmt":"2015-11-11T05:37:59","slug":"%ef%bc%93%ef%bd%84%e3%83%97%e3%83%aa%e3%83%b3%e3%82%bf%e3%81%a7%e7%ab%8b%e4%bd%93%e5%9c%b0%e5%9b%b3%ef%bc%88%ef%bc%93%ef%bc%89%e3%80%80excel%e6%9c%80%e5%a4%a7%e8%a1%8c%e8%b6%85%e3%83%87%e3%83%bc","status":"publish","type":"post","link":"http:\/\/kassan.www2.jp\/?p=398","title":{"rendered":"\uff13\uff24\u30d7\u30ea\u30f3\u30bf\u3067\u7acb\u4f53\u5730\u56f3\uff08\uff13\uff09\u3000Excel\u6700\u5927\u884c\u8d85\u30c7\u30fc\u30bf\u306e\u5909\u63db"},"content":{"rendered":"<p><span style=\"font-size: 13px; line-height: 19px;\">\u57fa\u76e4\u5730\u56f3\u60c5\u5831\u95b2\u89a7\u30b3\u30f3\u30d0\u30fc\u30c8\u30bd\u30d5\u30c8\u3067\u66f8\u304d\u51fa\u3057\u305f\uff58\uff59\uff5a\u30d5\u30a1\u30a4\u30eb\u306e\uff29\uff24\u524a\u9664\u3068\uff58\uff59\u5165\u63db\u306f\uff25\uff58\uff43\uff45\uff4c\uff44\uff45\u884c\u3046\u3068\u624b\u8efd\u3067\u3059\u304c<br \/>\n\uff25\uff58\uff43\uff45\uff4c\uff12\uff10\uff10\uff17\u306e\u6700\u5927\u884c\u6570\u306f\u300c104\u4e078576\u884c\u300d\u3067\u3061\u3087\u3063\u3068\u5e83\u3081\u306e\u7bc4\u56f2\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u8efd\u304f\u30aa\u30fc\u30d0\u30fc\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u3053\u3093\u306a\u5834\u5408\u306e\u305f\u3081\u306b\uff36\uff22\uff21\u3067\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066\uff11\u884c\u3065\u3064\u66f8\u304d\u51fa\u3059\u30de\u30af\u30ed\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002<br \/>\n\u5c11\u3005\u6642\u9593\u306f\u304b\u304b\u308a\u307e\u3059\u304c\u5909\u63db\u3067\u304d\u307e\u3059\u3002\u6a19\u9ad8\u5024\u3092\uff13\u500d\u306b\u3059\u308b\u3068\u304b\u3044\u308d\u3044\u308d\u7d30\u304b\u3044\u51e6\u7406\u3082\u4e00\u7dd2\u306b\u3067\u304d\u305d\u3046\u3067\u3059\u3002<\/span><\/p>\n<p><a href=\"http:\/\/kassan.www2.jp\/wp-content\/uploads\/2013\/06\/xyz_FileConv1.xls\" class=\"mtli_attachment mtli_xls\">xyz_FileConv<\/a><\/p>\n<p><a href=\"http:\/\/kassan.www2.jp\/wp-content\/uploads\/2013\/06\/2013-06-03_16h38_23.png\" rel=\"lightbox[398]\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-large wp-image-403\" title=\"2013-06-03_16h38_23\" src=\"http:\/\/kassan.www2.jp\/wp-content\/uploads\/2013\/06\/2013-06-03_16h38_23-640x382.png\" alt=\"\" width=\"640\" height=\"382\" srcset=\"http:\/\/kassan.www2.jp\/wp-content\/uploads\/2013\/06\/2013-06-03_16h38_23-640x382.png 640w, http:\/\/kassan.www2.jp\/wp-content\/uploads\/2013\/06\/2013-06-03_16h38_23-300x179.png 300w, http:\/\/kassan.www2.jp\/wp-content\/uploads\/2013\/06\/2013-06-03_16h38_23.png 1415w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Excel VBA \u306e\u30bd\u30fc\u30b9<\/p>\n<pre>\u00a0\r\nOption Explicit\r\nPrivate Sub CommandButton1_Click()\r\n    Dim FileType, Prompt, Item As String\r\n    Dim FileNamePath, TempFileNamePath As Variant\r\n    Dim textline As String\r\n    Dim i As Integer\r\n    Dim ch1, ch2 As Long\r\n    Dim csv As Variant\r\n\r\n    FileType = \"XYZ\uff8c\uff67\uff72\uff99 (*.xyz),*.xyz\"\r\n    Prompt = \"File \u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\"\r\n\r\n    FileNamePath = SelectFileNamePath(FileType, Prompt)  '\u64cd\u4f5c\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u53d6\u5f97\r\n\r\n    If FileNamePath = False Then                         '\u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\r\n        End\r\n    End If\r\n\r\n    ' CommandButton1.Enabled = False\r\n    Cells(2, 1) = \"\u5909\u63db\u4e2d\uff01\"\r\n    'Cells(2, 1) = crlfCount(FileNamePath)              '\u884c\u6570\u3092\u6c42\u3081\u308b\uff08\u6642\u9593\u304c\u304b\u304b\u308b\u2026\uff09\r\n\r\n    'Application.ScreenUpdating = False\r\n\r\n    ch1 = FreeFile                                      '\u7a7a\u3044\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u3092\u53d6\u5f97\r\n    Open FileNamePath For Input As #ch1                 'FileNamePath \u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30aa\u30fc\u30d7\u30f3\r\n\r\n    ch2 = FreeFile                                      '\u66f8\u51fa\u3057\u7528\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u3092\u53d6\u5f97\r\n    csv = Split(FileNamePath, \".\")\r\n    TempFileNamePath = csv(0) &amp; \"_cnv.xyz\"              '\u5909\u63db\u5148\u30d5\u30a1\u30a4\u30eb\u540d\r\n\r\n    Open TempFileNamePath For Output As #ch2            '\u5909\u63db\u5148\u30d5\u30a1\u30a4\u30eb\u30aa\u30fc\u30d7\u30f3\r\n\r\n    Do While Not EOF(1)                                 '\u30d5\u30a1\u30a4\u30eb\u306e\u7d42\u7aef\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\r\n        Line Input #ch1, textline                       '\u30c7\u30fc\u30bf\u884c\u3092\u8aad\u307f\u8fbc\u307f\r\n\r\n        csv = Split(textline, \",\")\r\n        textline = csv(2) &amp; \",\" &amp; csv(1) &amp; \",\" &amp; csv(3)\r\n        Print #ch2, textline                             '\u30c7\u30fc\u30bf\u306e\u66f8\u304d\u8fbc\u307f\r\n\r\n        ' Cells(1, 1) = csv(0)                          '\u5909\u63db\u4e2d\u306e\u884c\u3092\u8868\u793a\uff08\u6642\u9593\u304c\u304b\u304b\u308b\uff09\r\n        DoEvents\r\n    Loop\r\n\r\n    Close #ch1, #ch2                                    '\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u307e\u3059\r\n\r\n    'Kill FileNamePath                                  '\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\r\n    'Name TempFileNamePath As FileNamePath              '\u5909\u63db\u5148\u30d5\u30a1\u30a4\u30eb\u3092\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u306b\u5909\u66f4\r\n    'Application.ScreenUpdating = True\r\n    Cells(2, 1) = \"\u5909\u63db\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\"\r\n    'CommandButton1.Enabled = True\r\n\r\nEnd Sub\r\nFunction SelectFileNamePath(FileType, Prompt) As Variant\r\n  SelectFileNamePath = Application.GetOpenFilename(FileType, , Prompt)\r\nEnd Function<\/pre>\n<p>\u66f8\u304d\u51fa\u3057\u305f\uff58\uff59\uff5a\u30d5\u30a1\u30a4\u30eb\u3092\u76f4\u63a5\u8aad\u307f\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4ed8\u3051\u3066\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p>xxxx.xyz\u3000\u21d2\u3000xxxx_conv.xyz<\/p>\n<p>\u5909\u63db\u4e2d\u306f\u6c17\u9577\u306b\u5f85\u3061\u307e\u3057\u3087\u3046\u30fb\u30fb\u30fb<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u76e4\u5730\u56f3\u60c5\u5831\u95b2\u89a7\u30b3\u30f3\u30d0\u30fc\u30c8\u30bd\u30d5\u30c8\u3067\u66f8\u304d\u51fa\u3057\u305f\uff58\uff59\uff5a\u30d5\u30a1\u30a4\u30eb\u306e\uff29\uff24\u524a\u9664\u3068\uff58\uff59\u5165\u63db\u306f\uff25\uff58\uff43\uff45\uff4c\uff44\uff45\u884c\u3046\u3068\u624b\u8efd\u3067\u3059\u304c \uff25\uff58\uff43\uff45\uff4c\uff12\uff10\uff10\uff17\u306e\u6700\u5927\u884c\u6570\u306f\u300c104\u4e078576\u884c\u300d\u3067\u3061\u3087\u3063\u3068\u5e83\u3081\u306e\u7bc4\u56f2\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u8efd\u304f\u30aa\u30fc\u30d0\u30fc\u3057\u3066\u3057\u307e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":403,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=\/wp\/v2\/posts\/398"}],"collection":[{"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=398"}],"version-history":[{"count":9,"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions"}],"predecessor-version":[{"id":2721,"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions\/2721"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=\/wp\/v2\/media\/403"}],"wp:attachment":[{"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kassan.www2.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}