|
以下代码运行时出错,提示:运行时错误'450' 错误的参数号或无效的属性赋值。换成d.key(arr1(i,1))也出同样的错。
- Sub 大量数据匹配_zamyi字典()
- t1 = Timer()
- Dim Lst1 As Long '字典大小,必须设置为long,否则会出错
- Lst1 = Cells(Rows.Count, 1).End(xlUp).Row
- arr1 = Range("a1").Resize(Lst1, 2).Value
- Set d = New zDict
- d.SetBudgetCount Lst1 '设置字典的大小
- For i = 1 To Lst1
- d.Add CStr(arr1(i, 1)), CStr(arr1(i, 1))
- Next i
- Dim arr3()
- ReDim arr3(1 To Lst1, 1 To 1)
- For i = 1 To Lst1
- arr3(i, 1) = d(arr1(i, 2)) '出错
- Next i
- Erase arr1, arr3
- Set d = Nothing
- MsgBox Round(Timer - t1, 1) & "秒!"
- End Sub
复制代码 |
|