嗨我收到错误,因为下标超出范围,但我无法确定原因。我是VBA的新手,请帮帮我。谢谢。
答案 0 :(得分:1)
将t = 0
更改为t = 1
,因为arr
数组的维度始于1
(ReDim arr(1 To UBound(aryValues))
):
t = 1
For i = LBound(aryValues) + 1 To UBound(aryValues)
For Each v In dict.Keys
If v = aryMembers(i) And c = 0 Then
arr(t) = aryValues(i)
c = c + 1
t = t + 1
End If
Next
c = 0
Next