{"id":158,"date":"2025-03-18T20:18:32","date_gmt":"2025-03-18T11:18:32","guid":{"rendered":"https:\/\/web.monomatome.com\/?p=158"},"modified":"2025-03-22T01:31:28","modified_gmt":"2025-03-21T16:31:28","slug":"excel%e3%81%a7%e6%8c%87%e5%ae%9a%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%e4%b8%80%e6%8b%ac%e5%8f%96%e3%82%8a%e8%be%bc%e3%81%bf%e3%81%99","status":"publish","type":"post","link":"https:\/\/web.monomatome.com\/?p=158","title":{"rendered":"Excel\u3067\u6307\u5b9a\u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u53d6\u308a\u8fbc\u307f\u3059\u308b\u65b9\u6cd5\u3002VBA\u30fb\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3042\u308a\u3002"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u8907\u6570\u306eCSV\u30d5\u30a1\u30a4\u30eb\u30921\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u307e\u3068\u3081\u305f\u3044<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u3084\u308a\u305f\u3044\u3053\u3068<\/h3>\n\n\n\n<p>Excel\u3067\u3001\u5bfe\u8c61\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308b\u3059\u3079\u3066\u306eCSV\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30b7\u30fc\u30c8\u3068\u3057\u3066\u62bd\u51fa\u3057\u305f\u3044\u3002<br>csv\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30b7\u30fc\u30c8\u540d\u3068\u3059\u308b\u3002<br>\u30d5\u30a9\u30eb\u30c0\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u3053\u3093\u306a\u3068\u304d<\/h3>\n\n\n\n<p>\u8907\u6570\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u30b3\u30d4\u30da\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u3068\u304d\u3002<br>1\u5e74\u5206\u306eCSV\u30c7\u30fc\u30bf\u30921\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u307e\u3068\u3081\u305f\u3044\u3068\u304d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>VBA\u30b3\u30fc\u30c9<\/strong><\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u306eVBA\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u5bfe\u8c61\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u3059\u3079\u3066\u306eCSV\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3057\u3001\u305d\u308c\u305e\u308c\u306eCSV\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30b7\u30fc\u30c8\u540d\u3068\u3057\u3066\u65b0\u3057\u3044\u30b7\u30fc\u30c8\u306b\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u8fbc\u307f\u307e\u3059\u3002\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u901a\u3058\u3066\u884c\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u30d5\u30a9\u30eb\u30c0\u9078\u629e<\/li>\n\n\n\n<li>\u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u3001\u30b7\u30fc\u30c8\u3068\u3057\u3066\u8ffd\u52a0<\/li>\n\n\n\n<li>\u30b7\u30fc\u30c8\u540d\u306fCSV\u30d5\u30a1\u30a4\u30eb\u540d<\/li>\n\n\n\n<li>10\u500b\u306eCSV\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308c\u3070\u300110\u30b7\u30fc\u30c8\u8ffd\u52a0\u3055\u308c\u308b<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub \u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u3067\u30b7\u30fc\u30c8\u306b\u53d6\u308a\u8fbc\u3080()\nDim folder As String\nWith Application.FileDialog(msoFileDialogFolderPicker) &#39;\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u30c0\u30a4\u30a2\u30ed\u30b0\nIf .Show = False Then Exit Sub &#39;\u30ad\u30e3\u30f3\u30bb\u30eb\u306a\u3089\u7d42\u308f\u308a\nfolder = .SelectedItems(1) & &quot;\\&quot; &#39;\u30d5\u30a9\u30eb\u30c0+&quot;\\&quot;\nEnd With\n&#39;\nDim file As String\nDim wb As Workbook\nfile = Dir(folder & &quot;*.csv&quot;) &#39;\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u6700\u521d\u306ecsv\u30d5\u30a1\u30a4\u30eb\u540d\nDo While file &lt;&gt; &quot;&quot; &#39;\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u3042\u308b\u9593\nSet wb = Workbooks.Open(folder & file) &#39;csv\u3092Excel\u3067\u958b\u304f\nwb.Sheets(1).Move After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count) &#39;\u3053\u306eBook\u3082\u6700\u5f8c\u306b\u79fb\u52d5\nfile = Dir &#39;\u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u540d\nLoop\nEnd Sub\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u30b3\u30fc\u30c9\u306e\u52d5\u4f5c\u8aac\u660e<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u8868\u793a<\/strong><br>\u30de\u30af\u30ed\u5b9f\u884c\u6642\u306bCSV\u30d5\u30a1\u30a4\u30eb\u306e\u3042\u308b\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3002<\/li>\n\n\n\n<li><strong>CSV\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f<\/strong><br>\u9078\u629e\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u3059\u3079\u3066\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u9806\u306b\u958b\u3044\u3066\u51e6\u7406\u3002<br>(CSV\u4ee5\u5916\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u7121\u8996)<\/li>\n\n\n\n<li><strong>\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30b7\u30fc\u30c8\u540d\u3068\u3057\u3066\u8ffd\u52a0<\/strong>\n<ul class=\"wp-block-list\">\n<li>CSV\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u62e1\u5f35\u5b50\u306a\u3057\uff09\u3092\u30b7\u30fc\u30c8\u540d\u3068\u3057\u3066\u65b0\u3057\u3044\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\u3002<\/li>\n\n\n\n<li>\u30b7\u30fc\u30c8\u540d\u304c\u3059\u3067\u306b\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u3001\u300c\u30d5\u30a1\u30a4\u30eb\u540d(2)\u300d\u3068\u3057\u3066\u30b7\u30fc\u30c8\u3092\u8ffd\u52a0\u3002<\/li>\n\n\n\n<li>\u4f8b\uff1a\u30d5\u30a1\u30a4\u30eb\u540d\u300c2022-12.csv\u300d\u2192\u30b7\u30fc\u30c8\u540d\u300c2022-12\u300d<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>CSV\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u30c7\u30fc\u30bf\u3092\u30b3\u30d4\u30fc<\/strong><br>\u5404CSV\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u30c7\u30fc\u30bf\u3092\u8a72\u5f53\u3059\u308b\u30b7\u30fc\u30c8\u306b\u30b3\u30d4\u30fc\u3002<\/li>\n\n\n\n<li><strong>CSV\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b<\/strong><br>\u30c7\u30fc\u30bf\u3092\u30b3\u30d4\u30fc\u5f8c\u3001CSV\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\u3002<\/li>\n\n\n\n<li><strong>CSV\u30d5\u30a1\u30a4\u30eb\u306e\u4e00\u62ec\u53d6\u308a\u8fbc\u307f\u5b8c\u4e86<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u8907\u6570CSV\u306e\u5185\u5bb9\u304c\u30011\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u30b7\u30fc\u30c8\u6bce\u306b\u307e\u3068\u307e\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">VBA<strong>\u4f7f\u7528\u624b\u9806<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Excel\u3067VBA\u30a8\u30c7\u30a3\u30bf\u30fc\uff08Alt + F11\uff09\u3092\u958b\u304d\u3001\u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u30b3\u30fc\u30c9\u3092\u8cbc\u308a\u4ed8\u3051\u3002<\/li>\n\n\n\n<li>Excel\u306b\u623b\u308a\u3001\u300cAlt + F8\u300d\u3092\u62bc\u3057\u3066\u30de\u30af\u30ed\u306e\u4e00\u89a7\u3092\u8868\u793a\u3002<\/li>\n\n\n\n<li><code>\u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u3067\u30b7\u30fc\u30c8\u306b\u53d6\u308a\u8fbc\u3080<\/code> \u3092\u9078\u629e\u3057\u3066\u300c\u5b9f\u884c\u300d\u3002<\/li>\n\n\n\n<li>\u8868\u793a\u3055\u308c\u305f\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u3001CSV\u30d5\u30a1\u30a4\u30eb\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3002<\/li>\n\n\n\n<li>\u30d5\u30a9\u30eb\u30c0\u5185\u306eCSV\u30d5\u30a1\u30a4\u30eb\u304c\u9806\u6b21\u958b\u304b\u308c\u3001\u30c7\u30fc\u30bf\u62bd\u51fa\u5f8c\u306b\u81ea\u52d5\u3067\u9589\u3058\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/web.monomatome.com\/wp-content\/uploads\/sites\/2\/2025\/03\/image-9-300x158.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/web.monomatome.com\/?p=246\">\u3010\u8d85\u521d\u5fc3\u8005\u5411\u3051\u3011Excel VBA\u306e\u306f\u3058\u3081\u65b9\u3002\u521d\u671f\u8a2d\u5b9a\u3084VBA\u306e\u958b\u304d\u65b9\u30fb\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306a\u3069\u3002<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u300e\u77e5\u8b58\u30bc\u30ed\u3002\u306f\u3058\u3081\u3066VBA\u306b\u89e6\u308b\u3002\u300f\u3068\u3044\u3046\u4eba\u5411\u3051 Excel\u306e\u4f5c\u696d\u3092\u81ea\u52d5\u5316\u3067\u304d\u308b\u300cVBA\uff08Visual Basic for Applications\uff09\u300d\u30b9\u30bf\u30fc\u30c8\u6642\u306b\u5fc5\u8981\u306a\u6e96\u5099\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002\u300e\u4eca\u65e5\u3001&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<h3 class=\"wp-block-heading\">\u6ce8\u610f<\/h3>\n\n\n\n<p>\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u5927\u91cf\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u3068\u3001\u52d5\u4f5c\u5b8c\u4e86\u307e\u3067\u9045\u304f\u306a\u308b+\u30b7\u30fc\u30c8\u304c\u5927\u91cf\u306b\u751f\u6210\u3055\u308c\u307e\u3059\u3002<br>\u307e\u305a\u306f2-3\u30d5\u30a1\u30a4\u30eb\u3067\u52d5\u4f5c\u30c6\u30b9\u30c8\u3092\u63a8\u5968\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8907\u6570\u306eCSV\u30d5\u30a1\u30a4\u30eb\u30921\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u307e\u3068\u3081\u305f\u3044 \u3084\u308a\u305f\u3044\u3053\u3068 Excel\u3067\u3001\u5bfe\u8c61\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308b\u3059\u3079\u3066\u306eCSV\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30b7\u30fc\u30c8\u3068\u3057\u3066\u62bd\u51fa\u3057\u305f\u3044\u3002csv\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30b7\u30fc\u30c8\u540d\u3068\u3059\u308b\u3002\u30d5\u30a9\u30eb\u30c0\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u9078\u629e\u3067\u304d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":172,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"swell_btn_cv_data":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[5,14],"class_list":["post-158","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel","tag-excel","tag-vba"],"acf":[],"jetpack_featured_media_url":"https:\/\/web.monomatome.com\/wp-content\/uploads\/sites\/2\/2025\/03\/image-3.png","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/web.monomatome.com\/index.php?rest_route=\/wp\/v2\/posts\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/web.monomatome.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.monomatome.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.monomatome.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/web.monomatome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=158"}],"version-history":[{"count":11,"href":"https:\/\/web.monomatome.com\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions"}],"predecessor-version":[{"id":304,"href":"https:\/\/web.monomatome.com\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions\/304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/web.monomatome.com\/index.php?rest_route=\/wp\/v2\/media\/172"}],"wp:attachment":[{"href":"https:\/\/web.monomatome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.monomatome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.monomatome.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}