{"id":3061,"date":"2020-01-21T13:56:31","date_gmt":"2020-01-21T04:56:31","guid":{"rendered":"https:\/\/okamurax.com\/?p=3061"},"modified":"2020-01-22T04:25:00","modified_gmt":"2020-01-21T19:25:00","slug":"%e3%82%a8%e3%82%af%e3%82%bb%e3%83%abvba%e8%ac%9b%e5%ba%a7-%e3%83%af%e3%83%bc%e3%82%af%e3%82%b7%e3%83%bc%e3%83%88%e9%96%a2%e6%95%b0%e3%82%92%e6%8c%bf%e5%85%a5","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=3061","title":{"rendered":"VBA \u8b1b\u5ea7 \u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u633f\u5165"},"content":{"rendered":"<p>\u4ee5\u524d\u66f8\u3044\u305f\u30a8\u30af\u30bb\u30ebVBA\u8b1b\u5ea7\u306e\u7d9a\u304d\u3067\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"qgmrFqQyR8\"><p><a href=\"https:\/\/appbay.org\/?p=2923\">VBA \u8b1b\u5ea7<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;VBA \u8b1b\u5ea7&#8221; &#8212; \u30c6\u30c3\u30af\u30e1\u30e2\" src=\"https:\/\/appbay.org\/?p=2923&#038;embed=true#?secret=ijQQeXOMgc#?secret=qgmrFqQyR8\" data-secret=\"qgmrFqQyR8\" width=\"525\" height=\"296\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u4eca\u56de\u306f\u5c11\u3057\u5b9f\u7528\u7684\u306a\u3082\u306e\u3068\u3057\u3066\u30eb\u30fc\u30d7\u3067\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u633f\u5165\u3059\u308b\u65b9\u6cd5\u3092\u304a\u4f1d\u3048\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3060\u304b\u3089\u3068\u3044\u3063\u3066\u633f\u5165\u81ea\u4f53\u306b\u7279\u5225\u306a\u65b9\u6cd5\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u307e\u307e\u6587\u5b57\u3068\u3057\u3066\u5165\u529b\u3059\u308c\u3070\u5927\u4e08\u592b\u3067\u3059\u3002<\/p>\n<pre class=\"lang:vb decode:true\">Sheets(\"Sheet1\").Cells(1, 1).Value = \"=SUM(A2:A3)\"<\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001Sheet1\u3068\u3044\u3046\u30b7\u30fc\u30c8\u306eA1\u30bb\u30eb\u306bSUM\u95a2\u6570\u304c\u5165\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3082\u3046\u5c11\u3057\u4fbf\u5229\u306b\u3059\u308b\u305f\u3081\u306bFor\u30eb\u30fc\u30d7\u306e\u30ab\u30a6\u30f3\u30bf\u30fc\u5909\u6570\u3092\u5229\u7528\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"lang:vb decode:true\">For r = 1 To 4\r\nSheets(\"Sheet1\").Cells(r, 1).Value = \"=SUM(B\" &amp; r &amp; \":C\" &amp; r &amp; \")\"\r\nNext<\/pre>\n<p>\u7d30\u304b\u304f\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u5148\u305aFor\u30eb\u30fc\u30d7\u306e\u4e2d\u306e\u51e6\u7406\u306f4\u56de\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u3068\u304dr\u3068\u3044\u3046\u30ab\u30a6\u30f3\u30bf\u5909\u6570\u306f1,2,3,4\u3068\u3044\u3046\u3088\u3046\u306b\u5909\u5316\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>r\u306e\u5909\u5316\u3068\u6307\u5b9a\u3057\u3066\u3044\u308b\u30bb\u30eb\u306e\u4f4d\u7f6e\u3092\u8003\u3048\u3066\u307f\u308b\u3068\u3001<br \/>\nr\u304c1\u306e\u3068\u304dCells(1,2)<br \/>\nr\u304c2\u306e\u3068\u304dCells(2,2)<br \/>\nr\u304c3\u306e\u3068\u304dCells(3,2)<br \/>\nr\u304c4\u306e\u3068\u304dCells(4,2)<br \/>\n\u3068\u306a\u308a\u307e\u3059\u3002Cells\u306e\u4e2d\u8eab\u306f\u884c,\u5217\u3067\u3059\u306e\u3067\u3001A1,A2,A3,A4\u30bb\u30eb\u3092\u5bfe\u8c61\u306b\u3057\u3066\u633f\u5165\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>&#8220;=SUM(B&#8221; &amp; r &amp; &#8220;:C&#8221; &amp; r &amp; &#8220;)&#8221;\u306e\u90e8\u5206\u306b\u3064\u3044\u3066\u3001\u6587\u5b57\u3068\u3057\u3066\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u305f\u3044\u90e8\u5206\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3044\u3001\u5909\u6570\u306e\u4e2d\u8eab\u3092\u5229\u7528\u3057\u305f\u3044\u90e8\u5206\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u308f\u305a\u305d\u306e\u307e\u307e\u8a18\u5165\u3057\u307e\u3059\u3002\u305d\u308c\u3089\u3092\uff06\u8a18\u53f7(\u5de6\u53f3\u306b\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u5fc5\u9808)\u3067\u3064\u306a\u304e\u307e\u3059\u3002<\/p>\n<p>\uff0a\uff0a\uff0a<\/p>\n<p>\u3053\u306e\u90e8\u5206\u306f\u5206\u304b\u308a\u3065\u3089\u3044\u306e\u3082\u3046\u5c11\u3057\u7d30\u304b\u304f\u89e3\u8aac\u3059\u308b\u3068\u3001\u30bb\u30eb\u306e\u4e2d\u306b\u66f8\u304d\u8fbc\u3081\u308b\u5024\u306f\uff12\u7a2e\u985e(\u5b9f\u969b\u306f\u3082\u3063\u3068\u3042\u308a\u307e\u3059\u304c\u73fe\u6642\u70b9\u3067\u306f)\u3042\u308b\u3068\u8003\u3048\u3066\u304f\u3060\u3055\u3044\u3002\uff11\u3064\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3063\u305f\u6587\u5b57\u3001\u3082\u3046\uff11\u3064\u306f\u5909\u6570\u3067\u3001\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3063\u305f\u6587\u5b57\u306f\u305d\u306e\u307e\u307e\u66f8\u304d\u8fbc\u307e\u308c\u3001\u5909\u6570\u306f\u4e2d\u8eab\u304c\u5229\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u305d\u306e\uff12\u7a2e\u985e\u306f\uff06\u8a18\u53f7(\u5de6\u53f3\u306b\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u5fc5\u9808)\u3067\u3001\u9806\u756a\u3084\u6570\u306b\u5236\u9650\u306a\u304f\u81ea\u7531\u306b\u3064\u306a\u3050\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:vb decode:true \">v1 = \"hello\"\r\nv2 = \"world\"\r\n\r\nMsgBox v1 &amp; \" \" &amp; v2<\/pre>\n<pre class=\"lang:vb decode:true\">v1 = \"hello\"\r\nv2 = \" \"\r\nv3 = \"world\"\r\n\r\nMsgBox v1 &amp; v2 &amp; v3<\/pre>\n<p>\u3069\u3061\u3089\u3082\u5b9f\u884c\u3059\u308b\u3068hello world\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\uff0a\uff0a\uff0a<\/p>\n<p>\u8a71\u3092\u623b\u3057\u307e\u3059\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306br\u306e\u5909\u5316\u3092\u898b\u3066\u3044\u304f\u3068\u3001<br \/>\nr\u304c1\u306e\u3068\u304d\u3001&#8221;=SUM(B1:C1)&#8221;<br \/>\nr\u304c2\u306e\u3068\u304d\u3001&#8221;=SUM(B2:C2)&#8221;<br \/>\nr\u304c3\u306e\u3068\u304d\u3001&#8221;=SUM(B3:C3)&#8221;<br \/>\nr\u304c4\u306e\u3068\u304d\u3001&#8221;=SUM(B4:C4)&#8221;<br \/>\n\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3068\u3057\u3066<br \/>\nr\u304c1\u306e\u3068\u304d\u3001A1\u30bb\u30eb\u306b&#8221;=SUM(B1:C1)&#8221;<br \/>\nr\u304c2\u306e\u3068\u304d\u3001A2\u30bb\u30eb\u306b&#8221;=SUM(B2:C2)&#8221;<br \/>\nr\u304c3\u306e\u3068\u304d\u3001A3\u30bb\u30eb\u306b&#8221;=SUM(B3:C3)&#8221;<br \/>\nr\u304c4\u306e\u3068\u304d\u3001A4\u30bb\u30eb\u306b&#8221;=SUM(B4:C4)&#8221;<br \/>\n\u304c\u5165\u308b\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>For\u30eb\u30fc\u30d7\u306e\u30ab\u30a6\u30f3\u30bf\u5909\u6570\u3092\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u5229\u7528\u3059\u308b\u3053\u3068\u306f\u3088\u304f\u3042\u308a\u307e\u3059\u3002\u3080\u3057\u308d\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u56fa\u5b9a\u306e\u6587\u5b57\u5217\u3092\u633f\u5165\u3059\u308b\u3053\u3068\u306e\u65b9\u304c\u5c11\u306a\u3044\u3050\u3089\u3044\u3067\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u30ab\u30a6\u30f3\u30bf\u5909\u6570\u3092\u5229\u7528\u3057\u305f\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u633f\u5165\u3059\u308b\u65b9\u6cd5\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3068\u3001\u304b\u306a\u308a\u8907\u96d1\u306a\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u66f8\u3044\u305f\u30a8\u30af\u30bb\u30ebVBA\u8b1b\u5ea7\u306e\u7d9a\u304d\u3067\u3059\u3002 VBA \u8b1b\u5ea7 \u4eca\u56de\u306f\u5c11\u3057\u5b9f\u7528\u7684\u306a\u3082\u306e\u3068\u3057\u3066\u30eb\u30fc\u30d7\u3067\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u633f\u5165\u3059\u308b\u65b9\u6cd5\u3092\u304a\u4f1d\u3048\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3060\u304b\u3089\u3068\u3044\u3063\u3066\u633f\u5165\u81ea\u4f53\u306b\u7279\u5225\u306a\u65b9\u6cd5\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002\u305d &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=3061\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;VBA \u8b1b\u5ea7 \u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u633f\u5165&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5],"class_list":["post-3061","post","type-post","status-publish","format-standard","hentry","category-1","tag-vba"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3061"}],"version-history":[{"count":12,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3061\/revisions"}],"predecessor-version":[{"id":5088,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3061\/revisions\/5088"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}