求做一个Excel数据比较的宏
发布网友
发布时间:2023-08-28 13:15
我来回答
共1个回答
热心网友
时间:2024-12-02 22:42
sub mac()
for i=4 to nn 'nn为你表中最大行的数值
If Sheets("sheet2").Cells(i, 1) < Sheets("sheet3").Cells(i, 1) Then
ss = i & ":" & i
Worksheets("Sheet2").Select
Rows(ss).Select
With Selection.Interior
.Color = 255
End With
Else
If Sheets("sheet2").Cells(i, 1).Interior.Color = 255 Then
s1 = i & ":" & i
Worksheets("Sheet2").Select
Rows(s1).Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
End With
End If
End If
Next
End Sub