{"id":868,"date":"2020-12-27T14:09:34","date_gmt":"2020-12-27T05:09:34","guid":{"rendered":"https:\/\/beiyan-tool.info\/?p=868"},"modified":"2020-12-27T14:09:34","modified_gmt":"2020-12-27T05:09:34","slug":"vba%e3%81%a7%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e5%86%85%e3%81%aecsv%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e5%85%a8%e9%83%a8%e6%96%b0%e3%81%97%e3%81%84sheet%e3%81%a8%e3%81%97%e3%81%a6%e8%bf%bd","status":"publish","type":"post","link":"https:\/\/beiyan-tool.info\/?p=868","title":{"rendered":"VBA\u3067\u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u90e8\u65b0\u3057\u3044Sheet\u3068\u3057\u3066\u8ffd\u52a0\u3059\u308b\u30b3\u30fc\u30c9"},"content":{"rendered":"<p>VBA\u3067\u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u90e8\u65b0\u3057\u3044Sheet\u3068\u3057\u3066\u8ffd\u52a0\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<br \/>\n\u6708\u3054\u3068\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u3064\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306b\u8ffd\u52a0\u3057\u305f\u3044\u3068\u304d\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\t<p style=\"color:#666;margin-bottom:5px;\">\u30b9\u30dd\u30f3\u30b5\u30fc\u30ea\u30f3\u30af<\/p>\n\t<div class=\"middle-ad\">\n\t\t\t\t\t\t\t<div class=\"textwidget\"><p><script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<!-- \u6b66\u8853\u304c\u597d\u304d --><br \/>\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-8986630938426235\"\n     data-ad-slot=\"2584434263\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins><br \/>\n<script>\n(adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/p>\n<\/div>\n\t\t\t\t\t\t<\/div>\n\n\n<pre class=\"lang:default decode:true \" title=\"VBA\u3067\u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u90e8\u65b0\u3057\u3044Sheet\u3068\u3057\u3066\u8ffd\u52a0\u3059\u308b\u30b3\u30fc\u30c9\">Sub \u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u90e8\u958b\u304f()\r\n\r\n    '\u30d5\u30a9\u30eb\u30c0\u9078\u629e\r\n    With Application.FileDialog(msoFileDialogFolderPicker)\r\n        If .Show = True Then\r\n            Dim FSO As Object\r\n            Dim f As Variant\r\n            Set FSO = CreateObject(\"Scripting.FileSystemObject\")\r\n            For Each f In FSO.GetFolder(.SelectedItems(1)).Files\r\n                If LCase(FSO.GetExtensionName(f.Name)) = \"csv\" Then\r\n                    \u65b0\u3057\u3044\u30b7\u30fc\u30c8\u3067CSV\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f f.Path, FSO.GetBaseName(f.Name)\r\n                End If\r\n            Next f\r\n        End If\r\n    End With\r\n\r\nEnd Sub\r\n\r\n\r\nPrivate Sub \u65b0\u3057\u3044\u30b7\u30fc\u30c8\u3067CSV\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f(sPath As String, sSheetName As String)\r\n\r\n    Worksheets.Add after:=Worksheets(Worksheets.Count)\r\n\r\n    Dim ws As Worksheet\r\n    Set ws = ActiveSheet\r\n    \r\n    ws.Name = sSheetName\r\n\r\n    Dim qt As QueryTable\r\n    Set qt = ws.QueryTables.Add(Connection:=\"TEXT;\" &amp; sPath, Destination:=ws.Range(\"A1\"))\r\n    With qt\r\n        .TextFilePlatform = 932\r\n        .TextFileParseType = xlDelimited\r\n        .TextFileCommaDelimiter = True\r\n        .RefreshStyle = xlOverwriteCells\r\n        .Refresh\r\n        .Delete\r\n    End With\r\n\r\nEnd Sub<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>VBA\u3067\u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u90e8\u65b0\u3057\u3044Sheet\u3068\u3057\u3066\u8ffd\u52a0\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3057\u305f\u3002 \u6708\u3054\u3068\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u3064\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306b\u8ffd\u52a0\u3057\u305f\u3044\u3068\u304d\u306b\u4fbf\u5229\u3067\u3059\u3002 Sub \u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-868","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=868"}],"version-history":[{"count":1,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/868\/revisions"}],"predecessor-version":[{"id":869,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=\/wp\/v2\/posts\/868\/revisions\/869"}],"wp:attachment":[{"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beiyan-tool.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}