{"id":138,"date":"2016-09-29T17:15:17","date_gmt":"2016-09-29T08:15:17","guid":{"rendered":"http:\/\/okamurax.com\/?p=138"},"modified":"2016-09-29T17:15:50","modified_gmt":"2016-09-29T08:15:50","slug":"vba-%e8%a4%87%e6%95%b0%e3%81%ae%e3%82%b7%e3%83%bc%e3%83%88%e3%82%92%e7%b5%90%e5%90%88","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=138","title":{"rendered":"VBA \u8907\u6570\u306e\u30b7\u30fc\u30c8\u3092\u7d50\u5408"},"content":{"rendered":"<p>\u8907\u6570\u306e\u30b7\u30fc\u30c8\u3092\u7d50\u5408\u5f8c\u306b\u3001\u7279\u5b9a\u306e\u5217\u304c\u7a7a\u767d\u30010\u3001\u6570\u5024\u4ee5\u5916\u306e\u884c\u3092\u524a\u9664\u3059\u308b\u3002<\/p>\n<pre class=\"lang:vb decode:true \">Sub Cp()\r\nFor Each w In Sheets\r\n    If w.Name = \"\u96c6\u8a08\" Then Sheets(\"\u96c6\u8a08\").Delete\r\nNext w\r\nSheets.Add Before:=Sheets(1)\r\nActiveSheet.Name = \"\u96c6\u8a08\"\r\nFor Each w In Worksheets\r\n    If w.Name &lt;&gt; \"\u96c6\u8a08\" Then\r\n        If Sheets(\"\u96c6\u8a08\").UsedRange.Rows.Count = 1 Then\r\n            r = 1\r\n        Else\r\n            r = Sheets(\"\u96c6\u8a08\").UsedRange.Rows.Count + 1\r\n        End If\r\n        w.UsedRange.Copy\r\n        Sheets(\"\u96c6\u8a08\").Cells(r, 1).PasteSpecial Paste:=xlPasteValues\r\n        Sheets(\"\u96c6\u8a08\").Cells(r, 1).PasteSpecial Paste:=xlPasteFormats\r\n        Application.CutCopyMode = False\r\n        w.UsedRange.ClearContents\r\n    End If\r\nNext w\r\nc = 19 '\u5224\u65ad\u5217\r\nk = 2\r\nFor i = 1 To Sheets(\"\u96c6\u8a08\").UsedRange.Rows.Count\r\n    Application.StatusBar = \"\u524a\u9664\u4e2d ... \" &amp; i\r\n    If Sheets(\"\u96c6\u8a08\").Cells(k, c).Value = \"\" Or Sheets(\"\u96c6\u8a08\").Cells(k, c).Value = 0 Or IsNumeric(Sheets(\"\u96c6\u8a08\").Cells(k, c).Value) = False Then\r\n        Sheets(\"\u96c6\u8a08\").Rows(k).Delete\r\n    Else\r\n        k = k + 1\r\n    End If\r\nNext i\r\nFor Each w In Sheets\r\n    If w.Name &lt;&gt; \"\u96c6\u8a08\" Then w.Delete\r\nNext w\r\nApplication.StatusBar = False\r\nMsgBox \"done\"\r\nEnd Sub\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8907\u6570\u306e\u30b7\u30fc\u30c8\u3092\u7d50\u5408\u5f8c\u306b\u3001\u7279\u5b9a\u306e\u5217\u304c\u7a7a\u767d\u30010\u3001\u6570\u5024\u4ee5\u5916\u306e\u884c\u3092\u524a\u9664\u3059\u308b\u3002 Sub Cp() For Each w In Sheets If w.Name = &#8220;\u96c6\u8a08&#8221; Then Sheets(&#8220;\u96c6\u8a08&#8221;).Delete Nex &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=138\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;VBA \u8907\u6570\u306e\u30b7\u30fc\u30c8\u3092\u7d50\u5408&#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-138","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\/138","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=138"}],"version-history":[{"count":2,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/138\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/138\/revisions\/140"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}