|
Option Explicit
Sub TEST2()
Dim ar, i&, j&, r&
With [A4].CurrentRegion
.Interior.Color = xlNone
ar = .Value
For i = 2 To UBound(ar)
If CBool(Len(ar(i, 5))) And CBool(Len(ar(i, 6))) Then
If IsNumeric(ar(i, 5)) Then
If Not IsNumeric(ar(i, 6)) Then MsgBox "第" & .Rows(i).Row & " 行不一致": .Rows(i).Interior.Color = vbRed
Else
If IsNumeric(ar(i, 6)) Then MsgBox "第" & .Rows(i).Row & " 行不一致": .Rows(i).Interior.Color = vbRed
End If
Else
If CBool(Len(ar(i, 5))) Xor CBool(Len(ar(i, 6))) Then
MsgBox "第" & .Rows(i).Row & " 行不一致": .Rows(i).Interior.Color = vbRed
End If
End If
Next i
End With
Beep
End Sub |
评分
-
1
查看全部评分
-
|