Sub absentsPresents()
Dim t, u, der&, dico, i&, j&, maClef As String, v
With Sheets("liste")
If .FilterMode Then .ShowAllData
der = .Cells(Rows.Count, "a").End(xlUp).Row
t = .Range("a1:a" & der)
u = .Range("b1:b" & der)
Set dico = CreateObject("scripting.dictionary")
dico.CompareMode = TextCompare
For i = 2 To UBound(t)
For j = 2 To UBound(u)
If t(i, 1) <> "" Then
If Not dico.exists(t(j, 2)) Then
dico.Add t(i, 3)
End If
End If
Next j
Next i
Application.ScreenUpdating = False
.Range("J2:K" & Rows.Count).ClearContents
.Range("C2") = dico.Count
If dico.Count > 0 Then
.Range("C2").Resize(dico.Count) = Application.Transpose(dico.Keys)
.Range("C2").Resize(dico.Count).Sort key1:=.Range("J3"), order1:=xlAscending, MatchCase:=False, Header:=xlNo
End If
End With
End Sub