我想比较2个字典
dEmpty-键(类型:范围),值(类型:范围)
dFilled -key(类型:值),值(类型:范围)
我有这样的代码
For Each eRD In dEmpty.Keys
Set eRD = dEmpty.Item(eRDesc)
For Each e In dFilled.Keys
Dim inStrIndexFound as long, inStrIndexFoundDeep As Long
letterNum = InStr(e, dFilled.Item(e)),
If letterNum > 0 Then
newStrToFind = Mid(e, letterNum, Len(dFilled.Item(e)) + lettersCount)
End If
inStrIndexFoundDeep = InStr(eRD.Value, newStrToFind)
inStrIndexFound = InStr(eRD.Value, dFilled.Item(e ))
If inStrIndexFound > 0 Then
If inStrIndexFoundDeep > 0 Then
eRD.Value = dFilled.Item(e)
Cells(eRD.Row, 1) = "No"
End If
With eRD.Characters(start:=inStrIndexFound, Length:=Len(dFilled.Item(e))).Font
SomeAction
End With
Exit For
End If
Next
Next
如何改进和优化此宏,在大型词典上花费的时间很长(例如dEmpty中的30k个元素和dFilled中的10k个元素)。
我的代码中哪些操作对宏速度最昂贵?