Sub 查找相同点()
工作握含簿1 = ActiveWorkbook.Name
Sheets("表1").Select
H1 = 2
H2 = Cells(65536, 1).End(xlUp).Row
L1 = 1
L2 = Cells(1, 256).End(xlToLeft).Column
悔皮雹 For H = H1 To H2
For L = L1 To L2
If Sheets("表1").Cells(H, L) <>Sheets("表2").Cells(H, L) Then
Sheets("表3").Cells(H, L) = LTrim(Str$(Sheets("表1"碧帆).Cells(H, L))) + "," + LTrim(Str$(Sheets("表2").Cells(H, L)))
End If
Next
Next
End Sub
又如A.xls与B.xls两个工作簿散举的Sheet1工作表的A1单元格进行比较:if workbooks("罩蚂A.xls").sheet1.range("A1"冲闷碧)=workbooks("B.xls").sheet1.range("A1") then
如果比较的单元格较多就用循环语句。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)