Sub remplir_tableau_GLOBAL()
Dim Tbl, MonDico As Dictionary, MonDicoA As Dictionary, DateDebut As Date, DateFin As Date
Dim C As Byte, DerL As Long, L As Long, Ligne As Long, Indice As Long, Clé As String, CléBase As String
If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
'MOIS_PRESENCE.Show
'tps = Timer
Application.Calculation = xlCalculationManual
DateDebut = "01/10/2013"
DateFin = "01/12/2013"
With Feuil7
DerL = .Range("E65536").End(xlUp).Row
Tbl = .Range("A9:AC22") ' & derl)
End With
Set MonDico = New Dictionary
For C = 1 To UBound(Tbl, 2)
If Tbl(1, C) = DateDebut Then coldebut = C
If Tbl(1, C) = DateFin Then colfin = C: Exit For
Next C
For L = 2 To UBound(Tbl, 1)
MonDico(Tbl(L, 5) & "-" & Tbl(L, 14)) = Tbl(L, 5) & "-" & Tbl(L, 14) 'colonne E et N
Next L
'indexe le tableau
For Each Item In MonDico.Items
Set MonDicoA = New Dictionary
For L = 2 To UBound(Tbl, 1)
If Tbl(L, 5) & "-" & Tbl(L, 14) = Item Then 'colonne E et N
CléBase = Item
Clé = CléBase
Indice = 1
Do While MonDicoA.Exists(Clé)
Clé = CléBase & Indice
Indice = Indice + 1
Loop
MonDicoA(Clé) = L
End If
Next L
'écrit dans feuille
lb = 10
CléBase = Item
Clé = CléBase
Indice = 1
Do While MonDicoA.Exists(Clé)
Ligne = MonDicoA(Clé)
With Feuil2 'résultat dans data
.Range("A" & lb).Value = Tbl(Ligne, 5)
.Range("B" & lb).Value = Tbl(Ligne, 14)
For C = coldebut To colfin
If lb = 10 Then .Cells(9, C - 12).Value = Tbl(1, C)
.Cells(lb, C - 12).Value = Tbl(Ligne, C)
Next C
' .Range("D" & Lb).Value = Tbl(Ligne, 15)
' .Range("E" & Lb).Value = Tbl(Ligne, 18)
' .Range("F" & Lb).Value = Tbl(Ligne, 19)
' .Range("G" & Lb).Value = Tbl(Ligne, 28)
' .Range("H" & Lb).Value = Tbl(Ligne, 29)
' .Range("I" & Lb).Value = Tbl(Ligne, 30)
' .Range("J" & Lb).Value = Tbl(Ligne, 31)
' .Range("K" & Lb).Value = Tbl(Ligne, 32)
' .Range("M" & Lb).Value = Tbl(Ligne, 14)
' .Range("Q" & Lb).Value = Tbl(Ligne, 16)
End With
lb = lb + 1
Clé = CléBase & Indice
Indice = Indice + 1
Loop
Next Item
Application.Calculation = xlCalculationAutomatic
End Sub