|
楼主 |
发表于 2019-2-20 15:20
|
显示全部楼层
问题不是太占系统资源
而是系统资源使用严重不足,任务管理器一直显示CPU只有60%,内存只用了100M
代码很简单 就是一个标记重复项目,
Sub 对比all()
Dim arr, brr(1 To 100000, 1 To 4)
Set d = CreateObject("scripting.dictionary")
mypath = ThisWorkbook.Path & "\"
myname = Dir(mypath & "判定记录总表.xlsx")
Set wb = Workbooks.Open(mypath & myname)
With wb
With .Worksheets("all")
r = .Cells(.Rows.Count, 1).End(xlUp).Row
arr = .Range("a1:b" & r)
For i = 2 To UBound(arr)
d(arr(i, 2)) = i
Next
End With
.Close False
End With
With Worksheets("200")
.Cells.Interior.ColorIndex = xlNone
r = .Cells(.Rows.Count, 1).End(xlUp).Row
arr = .Range("a1:d" & r)
For i = 2 To UBound(arr)
If d.exists(arr(i, 4)) Then
.Cells(i, 4).Interior.ColorIndex = 3
End If
Next
End With
End Sub |
|