{"id":1030,"date":"2018-12-03T11:48:19","date_gmt":"2018-12-03T02:48:19","guid":{"rendered":"https:\/\/vongg.com\/?p=1030"},"modified":"2018-12-03T12:40:48","modified_gmt":"2018-12-03T03:40:48","slug":"excel-cell-%e6%af%94%e8%bc%83","status":"publish","type":"post","link":"https:\/\/vongg.com\/?p=1030","title":{"rendered":"excel Cell \u6bd4\u8f03"},"content":{"rendered":"<p>\u697d\u3005(^-^)\u30b3\u30f3\u30da\u30a2<\/p>\n<p>\u30b7\u30fc\u30c8\u300c\u306f\u3058\u3081\u306b\u300d:\u5b9f\u884c\u30dc\u30bf\u30f3<\/p>\n<p>\u30b7\u30fc\u30c8\u300c\u30b3\u30f3\u30da\u30a2\uff11\u300d<\/p>\n<p>\u30b7\u30fc\u30c8\u300c\u30b3\u30f3\u30da\u30a2\uff12\u300d<\/p>\n<table style=\"height: 88px;\" border=\"0\" width=\"888\" cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col width=\"72\" \/><\/colgroup>\n<tbody>\n<tr>\n<td width=\"72\" height=\"18\"><span style=\"color: #ff0000; font-family: \uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af;\">\u25cf\u4f7f\u7528\u65b9\u6cd5<\/span><\/td>\n<\/tr>\n<tr>\n<td height=\"18\"><span style=\"color: #ff0000; font-family: \uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af;\">\u2460 \u30b7\u30fc\u30c8\u300c\u30b3\u30f3\u30da\u30a2\uff11\u300d\u3001\u53ca\u3073\u300c\u30b3\u30f3\u30da\u30a2\uff12\u300d\u306b\u3001\u305d\u308c\u305e\u308c\u6bd4\u8f03\u3059\u308b\u30c7\u30fc\u30bf\u3092\u8cbc\u308a\u4ed8\u3051\u308b\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td height=\"18\"><span style=\"color: #ff0000; font-family: \uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af;\">\u2461 \u5b9f\u884c\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3002<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>UserForm2\u3042\u308a\u3002<\/p>\n<p>Sub comp_main()<br \/>\nDim i As Integer<br \/>\nDim j As Integer<br \/>\nDim count As Integer<br \/>\nDim Sheet1() As String<br \/>\nDim Sheet2() As String<\/p>\n<p>&#8216;&#8212;&#8211;\u3000\u30c7\u30fc\u30bf\u5165\u529b\u9818\u57df\u53d6\u5f97\u51e6\u7406\u3000&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Dim x1 As Long<br \/>\nDim y1 As Long<br \/>\nDim x As Long<br \/>\nDim y As Long<\/p>\n<p>Sheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff11&#8221;).Select<br \/>\nOn Error Resume Next<br \/>\ny1 = Cells.Find(&#8220;*&#8221;, Range(&#8220;A1&#8221;), , , xlByRows, xlPrevious).Row<br \/>\nx1 = Cells.Find(&#8220;*&#8221;, Range(&#8220;A1&#8221;), , , xlByColumns, xlPrevious).Column<br \/>\nIf Err &lt;&gt; 0 Then<br \/>\nMsgBox &#8220;\u30b3\u30f3\u30da\u30a2\uff11\u30b7\u30fc\u30c8\u306b\u30c7\u30fc\u30bf\u304c\u3042\u308a\u307e\u305b\u3093\u3002&#8221;<br \/>\nGoTo 999<br \/>\nEnd If<br \/>\nOn Error GoTo 0<\/p>\n<p>Sheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff12&#8221;).Select<br \/>\nOn Error Resume Next<br \/>\ny = Cells.Find(&#8220;*&#8221;, Range(&#8220;A1&#8221;), , , xlByRows, xlPrevious).Row<br \/>\nx = Cells.Find(&#8220;*&#8221;, Range(&#8220;A1&#8221;), , , xlByColumns, xlPrevious).Column<br \/>\nIf Err &lt;&gt; 0 Then<br \/>\nMsgBox &#8220;\u30b3\u30f3\u30da\u30a2\uff12\u30b7\u30fc\u30c8\u306b\u30c7\u30fc\u30bf\u304c\u3042\u308a\u307e\u305b\u3093\u3002&#8221;<br \/>\nGoTo 999<br \/>\nEnd If<br \/>\nOn Error GoTo 0<\/p>\n<p>If x1 &gt; x Then<br \/>\nx = x1<br \/>\nEnd If<\/p>\n<p>If y1 &gt; y Then<br \/>\ny = y1<br \/>\nEnd If<\/p>\n<p>&#8216;&#8212;&#8211;\u3000\u30e1\u30a4\u30f3\u51e6\u7406\u3000&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>ReDim Sheet1(y, x)<br \/>\nReDim Sheet2(y, x)<\/p>\n<p>Sheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff11&#8221;).Select<br \/>\nApplication.ScreenUpdating = False<br \/>\nFor j = 1 To x<br \/>\nFor i = 1 To y<br \/>\nSheet1(i, j) = Cells(i, j)<br \/>\nNext i<br \/>\nNext j<\/p>\n<p>Sheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff12&#8221;).Select<br \/>\nFor j = 1 To x<br \/>\nFor i = 1 To y<br \/>\nSheet2(i, j) = Cells(i, j)<br \/>\nNext i<br \/>\nNext j<\/p>\n<p>Sheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff11&#8221;).Select<br \/>\nCells.Select<br \/>\nSelection.Interior.ColorIndex = xlNone<\/p>\n<p>Sheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff12&#8221;).Select<br \/>\nCells.Select<br \/>\nSelection.Interior.ColorIndex = xlNone<\/p>\n<p>count = 0<\/p>\n<p>For j = 1 To x<br \/>\nFor i = 1 To y<br \/>\nIf Sheet1(i, j) &lt;&gt; Sheet2(i, j) Then<br \/>\nSheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff11&#8221;).Select<br \/>\nCells(i, j).Select<br \/>\nSelection.Interior.ColorIndex = 4<br \/>\nSheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff12&#8221;).Select<br \/>\nCells(i, j).Select<br \/>\nSelection.Interior.ColorIndex = 4<br \/>\ncount = count + 1<br \/>\nEnd If<br \/>\nNext i<br \/>\nNext j<\/p>\n<p>Sheets(&#8220;\u30b3\u30f3\u30da\u30a2\uff11&#8221;).Select<\/p>\n<p>UserForm2.TextBox1.Value = count<br \/>\nUserForm2.Show<\/p>\n<p>999<\/p>\n<p>End Sub<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u697d\u3005(^-^)\u30b3\u30f3\u30da\u30a2 \u30b7\u30fc\u30c8\u300c\u306f\u3058\u3081\u306b\u300d:\u5b9f\u884c\u30dc\u30bf\u30f3 \u30b7\u30fc\u30c8\u300c\u30b3\u30f3\u30da\u30a2\uff11\u300d \u30b7\u30fc\u30c8\u300c\u30b3\u30f3\u30da\u30a2\uff12\u300d \u25cf\u4f7f\u7528\u65b9\u6cd5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[130],"tags":[],"_links":{"self":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/1030"}],"collection":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1030"}],"version-history":[{"count":2,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/1030\/revisions"}],"predecessor-version":[{"id":1032,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/1030\/revisions\/1032"}],"wp:attachment":[{"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}