DataBase is a Collection each element of which is an array of five String-type elements describing some object. I'm trying to sort the collection by a particular element of the array.
At this fragment of code I get
Run-time error 13. Type mismatch
Dim DataBase As New Collection
For i = 1 To DataBase.Count - 1
For j = i + 1 To DataBase.Count
If DataBase.Item(i)(1) > DataBase.Item(j)(1) Then
temp = DataBase(j)
DataBase.Remove (j)
DataBase.Add temp, temp, i
End If
Next j
Next i
Tried accessing elements of the collection using Collection.Item (Index)
and Collection(Index)
but cannot get the sorted collection.