{"id":6479,"date":"2024-10-03T12:38:11","date_gmt":"2024-10-03T03:38:11","guid":{"rendered":"https:\/\/appbay.org\/?p=6479"},"modified":"2024-10-03T12:50:38","modified_gmt":"2024-10-03T03:50:38","slug":"vba-foreach%e9%85%8d%e5%88%97%e3%83%ab%e3%83%bc%e3%83%97rc%e5%bd%a2%e5%bc%8f%e3%82%a2%e3%83%89%e3%83%ac%e3%82%b9%e5%8f%96%e5%be%97%e6%9d%a1%e4%bb%b6%e4%bb%98%e6%9b%b8%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=6479","title":{"rendered":"VBA \u6587\u5b57\u5217\u5206\u5272ForEach,RC\u304b\u3089A1\u30a2\u30c9\u30ec\u30b9\u53d6\u5f97,\u6761\u4ef6\u4ed8\u66f8\u5f0f"},"content":{"rendered":"<pre class=\"lang:vb decode:true \">Sub SetColor()\r\n\r\nSet w = Sheets(\"Sheet1\")\r\n\r\nFor Each c In Split(\"2,3,17,23,24,38,39\", \",\")\r\n\r\n  alphabet = Split(w.Cells(1, CInt(c)).Address, \"$\")(1)\r\n \r\n  For r = 2 To 300\r\n \r\n    Set f = w.Cells(r, CInt(c)).FormatConditions.Add(xlExpression, xlEqual, \"=\" &amp; alphabet &amp; r &amp; \"=\"\"\u672a\"\"\")\r\n    f.Font.Color = RGB(255, 0, 0)\r\n    f.Interior.Color = RGB(255, 255, 0)\r\n    f.StopIfTrue = False\r\n   \r\n    Set f = w.Cells(r, CInt(c)).FormatConditions.Add(xlExpression, xlEqual, \"=\" &amp; alphabet &amp; r &amp; \"=\"\"\u6e08\u307f\"\"\")\r\n    f.Font.Color = RGB(0, 0, 0)\r\n    f.Interior.Color = RGB(150, 150, 150)\r\n    f.StopIfTrue = False\r\n \r\n  Next\r\n\r\nNext\r\n\r\nEnd Sub\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sub SetColor() Set w = Sheets(&#8220;Sheet1&#8221;) For Each c In Split(&#8220;2,3,17,23,24,38,39&#8221;, &#8220;,&#8221;) alphabet = Split(w.Cell &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=6479\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;VBA \u6587\u5b57\u5217\u5206\u5272ForEach,RC\u304b\u3089A1\u30a2\u30c9\u30ec\u30b9\u53d6\u5f97,\u6761\u4ef6\u4ed8\u66f8\u5f0f&#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-6479","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\/6479","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=6479"}],"version-history":[{"count":2,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/6479\/revisions"}],"predecessor-version":[{"id":6481,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/6479\/revisions\/6481"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}