{"id":2085,"date":"2017-11-20T23:22:57","date_gmt":"2017-11-20T14:22:57","guid":{"rendered":"http:\/\/okamurax.com\/?p=2085"},"modified":"2017-11-21T00:53:45","modified_gmt":"2017-11-20T15:53:45","slug":"vba-%e3%82%bb%e3%83%ab%e5%86%85%e3%81%ae%e6%95%b0%e5%bc%8f%e4%b8%80%e8%a6%a7","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=2085","title":{"rendered":"VBA \u30bb\u30eb\u5185\u306e\u6570\u5f0f\u4e00\u89a7"},"content":{"rendered":"<p>\u30bb\u30eb\u5185\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u6570\u5f0f\u3092\u629c\u304d\u51fa\u3059\u3002<\/p>\n<p>\u30b7\u30fc\u30c8\uff11\u679a\u305a\u3064\u3002<\/p>\n<pre class=\"lang:vb decode:true\">Sub test()\r\n\r\nSet s1 = ActiveSheet\r\n\r\nSheets.Add after:=s1: Set s2 = ActiveSheet\r\n\r\nFor r = 1 To s1.UsedRange.Rows.Count\r\n  For c = 1 To s1.UsedRange.Columns.Count\r\n    If InStr(s1.Cells(r, c).Formula, \"=\") &gt; 0 Then s2.Cells(r, c).Value = \"'\" &amp; s1.Cells(r, c).Formula\r\n  Next c\r\nNext r\r\n\r\nEnd Sub<\/pre>\n<p>\u5168\u3066\u306e\u30b7\u30fc\u30c8\u3002<\/p>\n<pre class=\"lang:vb decode:true \">Sub test()\r\nSheets.Add after:=ActiveSheet\r\nSet d = ActiveSheet\r\ni = 1\r\nFor Each w In Sheets\r\n  If w.Name &lt;&gt; d.Name Then\r\n    For r = 1 To w.UsedRange.Rows.Count\r\n      For c = 1 To w.UsedRange.Columns.Count\r\n        If InStr(w.Cells(r, c).Formula, \"=\") &gt; 0 Then\r\n          d.Cells(i, 1).Value = \"'\" &amp; w.Cells(r, c).Formula\r\n          d.Cells(i, 2).Value = \"'\" &amp; w.Name\r\n          i = i + 1\r\n        End If\r\n      Next c\r\n    Next r\r\n  End If\r\nNext\r\nEnd Sub<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30bb\u30eb\u5185\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u6570\u5f0f\u3092\u629c\u304d\u51fa\u3059\u3002 \u30b7\u30fc\u30c8\uff11\u679a\u305a\u3064\u3002 Sub test() Set s1 = ActiveSheet Sheets.Add after:=s1: Set s2 = ActiveSheet For r = &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=2085\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;VBA \u30bb\u30eb\u5185\u306e\u6570\u5f0f\u4e00\u89a7&#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-2085","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\/2085","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=2085"}],"version-history":[{"count":3,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/2085\/revisions"}],"predecessor-version":[{"id":2088,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/2085\/revisions\/2088"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}