Sub RecapParOPetETAT_v4()
Dim DicTit As Dictionary, L As Long, C As Long, TRés(1 To 500, 1 To 12), _
Dpt As SsGr, Serv As SsGr, Site As SsGr, Eqp As SsGr, OP As SsGr, EC As SsGr, PH As SsGr, Détail
'Recherche les entetes des colonnes pour identifier le numero de la colonne.
Dim nC_PHASE&, nC_LibEQP&, nc_ETAT&, nC_BUD&
Dim LOt As ListObject
Set LOt = FDonn.ListObjects(1)
nC_PHASE = NColTab(LOt, "PHASE")
nC_OP = NColTab(LOt, "OP")
nc_ETAT = NColTab(LOt, "ETAT")
nC_BUD = NColTab(LOt, "BUD")
Set DicTit = GigIdx.DicInvent(LOt, "PHASE", nC_PHASE)
L = 1
For C = 1 To 5: TRés(L, C) = Choose(C, "DPT", "AB BUD", "AB BUD / En Cours", "AB BUD / En Cours / pour E1", " "): Next C
Set OP = GigIdx.Gigogne(Null, "OP", "DPT", "ETAT", "PHASE").Item("AB")
For Each Dpt In OP.Co
L = L + 1
TRés(L, 1) = Dpt.ID
TRés(L, 2) = Dpt.Somme(nC_BUD)
Set EC = Dpt.ItemSsGr("En cours")
If Not EC Is Nothing Then
TRés(L, 3) = EC.Somme(nC_BUD)
Set PH = EC.ItemSsGr("E1"): If Not PH Is Nothing Then TRés(L, 4) = PH.Somme(nC_BUD)
End If
Next Dpt
FDonn.[A15].Resize(500, 12).Value = TRés
End Sub