{"id":1396,"date":"2017-06-01T02:11:20","date_gmt":"2017-05-31T17:11:20","guid":{"rendered":"http:\/\/okamurax.com\/?p=1396"},"modified":"2017-06-01T02:11:20","modified_gmt":"2017-05-31T17:11:20","slug":"vba-%e5%a1%97%e3%82%8a%e3%81%a4%e3%81%b6%e3%81%97%ef%bc%86%e3%83%91%e3%82%bf%e3%83%bc%e3%83%b3%e3%82%92%e6%8c%87%e5%ae%9a%e3%82%bb%e3%83%ab%e6%95%b0%e5%88%86%e7%a7%bb%e5%8b%95","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=1396","title":{"rendered":"VBA \u5857\u308a\u3064\u3076\u3057\uff06\u30d1\u30bf\u30fc\u30f3\u3092\u6307\u5b9a\u30bb\u30eb\u6570\u5206\u79fb\u52d5"},"content":{"rendered":"<pre class=\"lang:vb decode:true  \">Private Sub CommandButton1_Click()\r\n\r\nFor i = Selection(1).Row To Selection(Selection.Count).Row '\u9078\u629e\u7bc4\u56f2\u306e\u884c\u3067\u30eb\u30fc\u30d7\r\n\r\n    For ii = 8 To 100\r\n    \r\n      If Cells(i, ii).Interior.Color = RGB(0, 0, 0) Then\r\n      \r\n          If ii - UserForm1.TextBox1.Value &lt; 8 Then Exit For\r\n          Cells(i, ii).Interior.ColorIndex = xlNone\r\n          Cells(i, ii - UserForm1.TextBox1.Value).Interior.Color = RGB(0, 0, 0)\r\n      \r\n      End If\r\n      \r\n      If Cells(i, ii).Interior.Pattern = 15 Then\r\n      \r\n          If ii - UserForm1.TextBox1.Value &lt; 8 Then Exit For\r\n          Cells(i, ii).Interior.Pattern = xlPatternNone\r\n          Cells(i, ii - UserForm1.TextBox1.Value).Interior.Pattern = 15\r\n      \r\n      End If\r\n    \r\n    Next ii\r\n\r\nNext i\r\n\r\nEnd Sub\r\n\r\nPrivate Sub CommandButton2_Click()\r\n\r\nFor i = Selection(1).Row To Selection(Selection.Count).Row '\u9078\u629e\u7bc4\u56f2\u306e\u884c\u3067\u30eb\u30fc\u30d7\r\n\r\n    For ii = 100 To 8 Step -1\r\n    \r\n      If Cells(i, ii).Interior.Color = RGB(0, 0, 0) Then\r\n      \r\n          If ii + UserForm1.TextBox1.Value &gt; 100 Then Exit For\r\n          Cells(i, ii).Interior.ColorIndex = xlNone\r\n          Cells(i, ii + UserForm1.TextBox1.Value).Interior.Color = RGB(0, 0, 0)\r\n      \r\n      End If\r\n      \r\n      If Cells(i, ii).Interior.Pattern = 15 Then\r\n      \r\n          If ii + UserForm1.TextBox1.Value &gt; 100 Then Exit For\r\n          Cells(i, ii).Interior.Pattern = xlPatternNone\r\n          Cells(i, ii + UserForm1.TextBox1.Value).Interior.Pattern = 15\r\n      \r\n      End If\r\n    \r\n    Next ii\r\n\r\nNext i\r\n\r\nEnd Sub<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Private Sub CommandButton1_Click() For i = Selection(1).Row To Selection(Selection.Count).Row &#8216;\u9078\u629e\u7bc4\u56f2\u306e\u884c\u3067\u30eb\u30fc\u30d7 For  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=1396\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;VBA \u5857\u308a\u3064\u3076\u3057\uff06\u30d1\u30bf\u30fc\u30f3\u3092\u6307\u5b9a\u30bb\u30eb\u6570\u5206\u79fb\u52d5&#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-1396","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\/1396","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=1396"}],"version-history":[{"count":1,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/1396\/revisions"}],"predecessor-version":[{"id":1397,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/1396\/revisions\/1397"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}