Dim coll As New Collection
On Error Resume Next
For i = Lbound(AccountManagers) to UBound(AccountManagers)
coll.Add AccountManagers(i),AccountManagers(i)
Next i
On Error Goto 0
'you now have a collection of the unique items from your array:
For i = 0 to coll.Count - 1
Cells(i,1) = coll(i)
Next i
Dim uniqueArray() as Variant
Dim pointer As Long, i As Long
pointer = LBound(AccountManagers)
Redim uniqueArray(pointer - 1 To UBound(AccountManagers))
For i = LBound(AccountManagers) To UBound(AccountManagers)
If Not IsNumeric(Application.Match(AccountManagers(i), uniqueArray, 0)) Then
pointer = pointer + 1
uniqueArray(pointer) = AccountManagers(i)
End If
Next i
ReDim Preserve uniqueArray(LBound(AccountManagers) To pointer)
Dim AccountManagers As Variant
xVal = Sheets("Details").Cells(Rows.Count, 1).End(xlUp).Row
AccountManagers = Worksheets("Details").Range("D2:D" & xVal)
Sheets("Summary").Range("S1").Value = UBound(AccountManagers)
Dim uniqueArray() As Variant
Dim pointer As Long, i As Long
pointer = LBound(AccountManagers)
ReDim uniqueArray(pointer - 1 To UBound(AccountManagers))
For i = LBound(AccountManagers) To UBound(AccountManagers)
If Not IsNumeric(Application.Match(AccountManagers(i), uniqueArray, 0)) Then ' ERROR OUT OF RANGE HERE
pointer = pointer + 1
uniqueArray(pointer) = AccountManagers(i)
End If
Next i
ReDim Preserve uniqueArray(LBound(AccountManagers) To pointer)
Dim coll As New Collection
On Error Resume Next
For i = Lbound(AccountManagers) to UBound(AccountManagers)
coll.Add AccountManagers(i),AccountManagers(i)
Next i
On Error Goto 0
'you now have a collection of the unique items from your array:
For i = 1 to coll.Count
Cells(i,1) = coll(i)
Next i
Dim coll As New Collection
On Error Resume Next
For i = Lbound(AccountManagers) to UBound(AccountManagers)
coll.Add AccountManagers(i),CStr(AccountManagers(i))
Next i
On Error Goto 0
'you now have a collection of the unique items from your array:
For i = 1 to coll.Count
Cells(i,1) = coll(i)
Next i