|
如果重复的数据量不是很大(几百个),数组搞下就行了:
Dim arr(10000)
If [d100000].End(3).Row > 3 Then
Range(Cells(4, 4), Cells([d100000].End(3).Row, 4)).ClearContents
End If
js = 0
For i = 4 To [a100000].End(3).Row
s = Cells(i, 1) & Cells(i, 2) & Cells(i, 3)
bz = False
For k = 1 To js
If arr(k) = s Then
bz = True
Exit For
End If
Next k
If Not bz Then
js = js + 1
arr(js) = s
Else
Cells(i, 4) = "S"
End If
Next i
如果重复的数据量超过500,还是字典更快些。重复的数据越多,速度差距越大。关于字典代码到处都是,反而是数组的不好找,所以我给你写的是数组查询。 |
|