Subscript out of range ,VBA

后端 未结 1 1037
自闭症患者
自闭症患者 2021-01-26 05:38

Hi I am getting error as subscript out of range but i am unable to identify why.

Error is in line marked with **.

Function RemoveDups(aryValues) As Varia         


        
相关标签:
1条回答
  • 2021-01-26 05:53

    change t = 0 to t = 1 because dimmension of arr array starts from 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
    
    0 讨论(0)
提交回复
热议问题