有人能告诉我如何只比较一列而不是整张表吗? 谢谢。
Sub Compare()
Call compareSheets("Sofon", "Sofontest")
End Sub
Sub compareSheets(Sofon As String, Sofontest As String)
Dim mycell As Range
Dim mydiffs As Integer
For Each mycell In ActiveWorkbook.Worksheets(Sofontest).UsedRange
If Not mycell.Value = ActiveWorkbook.Worksheets(Sofon).Cells(mycell.Row, mycell.Column).Value Then
mycell.Interior.Color = vbYellow
mydiffs = mydiffs + 1
End If
Next
MsgBox mydiffs & " differences found", vbInformation
ActiveWorkbook.Sheets(Sofontest).Select
End Sub
答案 0 :(得分:0)
import sys
sys.path.append("..")
import NEW2.test2