Sub EtabliAbsentUnic()
Dim Absent() As String 'déclare un tableau non dimensionné
Dim C As Integer, Col As Integer, Cdebut As Integer, Cfin As Integer, CDest As Integer
Dim i As Integer, j As Integer, l As Integer, li As Integer, MonDico As Object
Dim Cel As Range, ListeRef As Variant
Cdebut = 3: Cfin = 30
li = 11: CDest = 116
'ListeRef = Range("Data!B2:B31")
With Worksheets("Data")
l = .Range("B1000").End(xlUp).Row
ListeRef = .Range("B1:B" & l)
End With
With Worksheets("Planning")
.Range("DK3:DQ100").ClearContents
Module2.SemDate 'appel procédure
For Col = Cdebut To 114 Step 30 'B à DA
Set MonDico = CreateObject("Scripting.Dictionary")
Set rng = .Range(.Cells(5, Col), .Cells(5, Col + 29))
For C = Col To Col + Cfin Step 4 'boucle lu à ve
For l = 1 To UBound(ListeRef, 1)
If Application.WorksheetFunction.CountIf(rng, "=" & ListeRef(l, 1)) > 0 Then Exit For
Set Cel = .Columns(C).Find(ListeRef(l, 1), LookIn:=xlValues, lookat:=xlWhole)
If Cel Is Nothing Then
If Not MonDico.Exists(ListeRef(l, 1)) Then MonDico.Add ListeRef(l, 1), ListeRef(l, 1) 'absent sans doublon
End If
Next l
Next C
For Each Item In MonDico.items
.Cells(li, CDest) = Item
li = li + 1
Next Item
li = 11
CDest = CDest + 2
Next Col
End With
End Sub