Hi,

I have got a Collection filled with all different entries of a class (clsOG).
I would like to check if a certain class property (g.name) is already present in the collection. If so i only want to update the class, if not add the class to the collection.

Dim g as clsOG '(.total, .name, .new and .exam)
Dim solvingGroups As New Collection
Dim group As Variant

If Blad1.Cells(i, 4) =Department A" Then
    Set g = DA
ElseIf Blad1.Cells(i, 4) = "Department B" Then
    Set g = DB

   With g
            .Total = .Totaal + 1 'totaal
            .Name = Blad1.Cells(i, 4)
    
            If Blad1.Cells(i, 3) = "New" Then
             .New = .New + 1
            End If 
            
            If Blad1.Cells(i, 3) = "Under examination" Then
             .Exam = .Exam + 1
            End If
    
   End With

solvinggroups.add g
With the code shown above, all entries are added to the collection, I want to end up only with the collection of discticnt 'g.names' with the correct counts.

Can anyone point me in the right direction?

TIA

ABBOV.