|
参与一下!
Public Sub check()
Dim lastRow As Integer
Dim dic As New Dictionary
Dim arr
Dim str1, str2
lastRow = UsedRange.Rows.Count
arr = Range("A1:L" & lastRow).Value
For i = 2 To lastRow
str1 = arr(i, 2) & "-" & arr(i, 3) & "-" & arr(i, 5) & "-" & arr(i, 6)
str2 = arr(i, 2) & "-" & arr(i, 3) & "-" & arr(i, 5) & "-" & arr(i, 11)
If dic.Exists(str1) Then
dic(str1) = dic(str1) + 1
Else
dic.Add str1, 1
End If
If dic.Exists(str2) Then
dic(str2) = dic(str2) + 1
Else
dic.Add str2, 1
End If
Next i
For i = 2 To lastRow
str1 = arr(i, 2) & "-" & arr(i, 3) & "-" & arr(i, 5) & "-" & arr(i, 6)
str2 = arr(i, 2) & "-" & arr(i, 3) & "-" & arr(i, 5) & "-" & arr(i, 11)
If dic(str1) > 1 Or dic(str2) > 1 Then Cells(i, "G") = "请仔细检查F列和K列"
Next i
End Sub
|
评分
-
1
查看全部评分
-
|