我要尋找一個宏可以做以下對比:宏全行的兩片
1)查看是否在組件表中確切同一信息存在於自MECH_COMBINED表任何行。 (MECH_COMBINED中有大約7000行,COMPONENTS中有大約20000個,每個表都有列上至BI相同列名的列)
2)如果MECH_COMBINED中的行存在,則突出顯示COMPONENTS表中的整行並創建第三個紙與不同行(如果多數民衆贊成不可能的,那麼第三張可能具有相同的高亮行
我希望這是一個可能的宏?我現在使用的一個運行方式過於緩慢,最終凍結的Excel。
Sub Test()
Application.ScreenUpdating = False
Dim bottomA1 As Integer bottomA1 = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row Dim c As Range
Dim bottomA2 As Integer bottomA2 = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row Dim x As Integer For Each c In Sheets("Sheet2").Range("A1:A" & bottomA2)
For x = bottomA1 To 2 Step -1 If Cells(x, 1) = c Then Cells(x, 1).EntireRow.Interior.Color = 255 End If Next x Next c Application.ScreenUpdating = True
End Sub
在此先感謝:)
及以下:http://verticalhorizons.in/macro-to-compare-two-excel-worksheets-and-copy-different-rows-to-new-worksheet/ – Shivster
請把你的代碼這個問題在哪裏可以被格式化爲可讀性。 –