{"id":18377,"date":"2024-12-19T06:00:00","date_gmt":"2024-12-18T21:00:00","guid":{"rendered":"https:\/\/www.muscle-hypertrophy.com\/?p=18377"},"modified":"2024-12-13T09:44:22","modified_gmt":"2024-12-13T00:44:22","slug":"excel-vba%e3%81%a7%e8%a4%87%e6%95%b0%e3%81%ae%e3%83%96%e3%83%83%e3%82%af%e3%81%8b%e3%82%89%e3%82%bf%e3%83%96%e5%8c%ba%e5%88%87%e3%82%8a%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%81%ab%e4%b8%80%e6%8b%ac","status":"publish","type":"post","link":"https:\/\/www.muscle-hypertrophy.com\/?p=18377","title":{"rendered":"EXCEL VBA\u3067\u8907\u6570\u306e\u30d6\u30c3\u30af\u304b\u3089\u30bf\u30d6\u533a\u5207\u308a\u30c6\u30ad\u30b9\u30c8\u306b\u4e00\u62ec\u3067\u5225\u540d\u4fdd\u5b58\u3059\u308b"},"content":{"rendered":"\n<p>\u3000\u6700\u8fd1\uff0cLancers\u3092\u5229\u7528\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\uff0e\u6708\u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u309210\u5e74\u5206\uff0c\u8a08120\u500b\u306e\u30d6\u30c3\u30af\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\uff0c\u30c6\u30fc\u30d6\u30eb\u5f62\u5f0f\u306b\u6574\u5f62\u3057\u305f\u30d6\u30c3\u30af\u304c\u7d0d\u54c1\u3055\u308c\u305f\uff0e\u3053\u308c\u3089\u3092SQL Server\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u305f\u3044\u306e\u3060\u304c\uff0c\u624b\u52d5\u3067\u30bf\u30d6\u533a\u5207\u308a\u30c6\u30ad\u30b9\u30c8\u306b\u5225\u540d\u4fdd\u5b58\u3059\u308b\u306e\u306f\u9aa8\u304c\u6298\u308c\u308b\uff0e<\/p>\n<p>\u3000\u7d50\u5c40VBA\u3067\u51e6\u7406\u3059\u308b\u3053\u3068\u306b\u3057\u305f\uff0e\u305d\u306e\u969b\u306e\u5099\u5fd8\u9332\u3067\u3042\u308b\uff0e<\/p>\n<p><!--more--><\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u3000\u51e6\u7406\u524d\u306e\u30d6\u30c3\u30af\u306f\u3059\u3079\u3066\u540c\u4e00\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308b\u3082\u306e\u3068\u3057\uff0c6\u6841\u306e\u56fa\u5b9a\u9577\u6587\u5b57\u5217\u3067\u30d6\u30c3\u30af\u540d\u304c\u547d\u540d\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3068\u3059\u308b\uff0e\u51e6\u7406\u3092\u884c\u3046\u30b3\u30fc\u30c9\u306e\u8a18\u8f09\u3055\u308c\u305f\u30de\u30af\u30ed\u30d6\u30c3\u30af\u3082\u540c\u4e00\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308b\u3082\u306e\u3068\u3059\u308b\uff0e<\/p>\n<p>\u3000\u5225\u540d\u4fdd\u5b58\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3082\u540c\u4e00\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u51fa\u529b\u3059\u308b\u3082\u306e\u3068\u3059\u308b\uff0e<\/p>\n<p>\u3000\u300c\u30c4\u30fc\u30eb\u300d\u30e1\u30cb\u30e5\u30fc\u306e\u300c\u53c2\u7167\u8a2d\u5b9a\u300d\u3067Microsoft Scripting Runtime\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u308b\uff0e<\/p>\n<h2>\u30b3\u30fc\u30c9<\/h2>\n<pre>Sub sample()\nDim myFSO   As Scripting.FileSystemObject\nDim myFiles As Scripting.Files\nDim myFile  As Scripting.File\nDim myWB    As Workbook\nDim i       As Long\n\nSet myFSO = New Scripting.FileSystemObject\nSet myFiles = myFSO.GetFolder(ThisWorkbook.Path).Files\nApplication.ScreenUpdating = False\ni = 0\nFor Each myFile In myFiles\n    With myFile\n        If Left(.Name, 3) = \"201\" And Right(.Name, 3) &lt;&gt; \"txt\" Then\n            Set myWB = Workbooks.Open(myFile.Path)\n            myWB.SaveAs Filename:=myFile.ParentFolder.Path &amp; \"\\\" &amp; Left(myFile.Name, 6) &amp; \".txt\", FileFormat:=xlText\n            myWB.Close\n            i = i + 1\n        End If\n    End With\nNext myFile\nApplication.ScreenUpdating = True\nMsgBox prompt:=i\nEnd Sub<\/pre>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3000\u8907\u6570\u306e\u30a8\u30af\u30bb\u30eb\u30d6\u30c3\u30af\u3092\u30bf\u30d6\u533a\u5207\u308a\u30c6\u30ad\u30b9\u30c8\u306b\u4e00\u62ec\u3067\u5225\u540d\u4fdd\u5b58\u3059\u308b\u65b9\u6cd5\u3092\u8a18\u3057\u305f\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u6700\u8fd1\uff0cLancers\u3092\u5229\u7528\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\uff0e\u6708\u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u309210\u5e74\u5206\uff0c\u8a08120\u500b\u306e\u30d6\u30c3\u30af\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\uff0c\u30c6\u30fc\u30d6\u30eb\u5f62\u5f0f\u306b\u6574\u5f62\u3057\u305f\u30d6\u30c3\u30af\u304c\u7d0d\u54c1\u3055\u308c\u305f\uff0e\u3053\u308c\u3089\u3092SQL Server\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u305f\u3044\u306e\u3060\u304c\uff0c\u624b\u52d5\u3067\u30bf\u30d6\u533a\u5207\u308a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.muscle-hypertrophy.com\/?p=18377\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;EXCEL VBA\u3067\u8907\u6570\u306e\u30d6\u30c3\u30af\u304b\u3089\u30bf\u30d6\u533a\u5207\u308a\u30c6\u30ad\u30b9\u30c8\u306b\u4e00\u62ec\u3067\u5225\u540d\u4fdd\u5b58\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[8404,8071,13903,13902,8315,8305,5815,8316,13897,5413,2474,8307,4528,5813,8326,8369,8317,9602,13901,8311,2740,5156,12945,4727,13900,13904,2861,11978,433,462,8291,13899,8308,7720,13898],"class_list":["post-18377","post","type-post","status-publish","format-standard","hentry","category-technology","tag-close","tag-file","tag-fileformat","tag-filename","tag-files","tag-filesystemobject","tag-for-each","tag-getfolder","tag-lancers","tag-left","tag-long","tag-microsoft-scripting-runtime","tag-name","tag-new","tag-open","tag-parentfolder","tag-path","tag-right","tag-saveas","tag-scripting","tag-sql-server","tag-thisworkbook","tag-txt-2","tag-workbook","tag-workbooks","tag-xltext","tag-2861","tag-11978","tag-433","tag-462","tag-8291","tag-13899","tag-8308","tag-7720","tag-13898"],"_links":{"self":[{"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/posts\/18377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18377"}],"version-history":[{"count":4,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/posts\/18377\/revisions"}],"predecessor-version":[{"id":18381,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/posts\/18377\/revisions\/18381"}],"wp:attachment":[{"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}