Re : votre aide svp
bonjour Hajar
un début de solution,je reprend ce soir
problème avec sommeprod
j'ai mis une formule en attendant(en e)
le reste est par code(voir module1)
j'ai supprimé cellules fusionnées,fin,etc
ajoute une feuille, nom= feuil1
à bientôt
dans un module
Private Sub TABLEAU_Click()
Dim Rng As Range
Dim Cel As Range, CelD As Range
Dim Col As New Collection
Dim Item As Variant
Dim Plg As Variant, Total As Variant
Dim L As Integer
Application.ScreenUpdating = False
With Sheets("ETAT")
' L = .Range("D65536").End(xlUp).Row
Set Rng = .Range("D16😀" & .Range("D65536").End(xlUp).Row)
End With
For Each Cel In Rng
On Error Resume Next
If Cel <> "" Then
If IsNumeric(Cel) Then Col.Add Cel, CStr(Cel)
End If
On Error GoTo 0
Next Cel
ReDim Plg(1 To Col.Count, 1 To 4)
For Each Item In Col
L = L + 1
Plg(L, 4) = Item
Next Item
'L = 1
For L = 1 To UBound(Plg, 1)
For Each Cel In Rng
'If L > UBound(Plg, 1) Then Exit For
If Cel = Plg(L, 4) Then
Plg(L, 1) = Cel.Offset(0, -3)
Plg(L, 2) = Cel.Offset(0, -2)
Plg(L, 3) = Cel.Offset(0, -1)
'For Each CelD In Rng
'If CelD = Plg(L, 4) Then Plg(L, 5) = Plg(L, 5) + Cel.Offset(0, 1)
'Next CelD
'NB = "SumProduct((IsNumeric(ColD))*(ColD =" & Plg(L, 4) & "),(ColE))"
'Plg(L, 5) = Evaluate("SumProduct((ColD<>"""")*(IsNumeric(ColD))*(ColD =" & Plg(L, 4) & ")*(ColE))")
'Plg(L, 6) = Cel.Offset(0, 2)
Exit For
End If
Next Cel
Next L
Sheets("Feuil1").Range("A1").Resize(UBound(Plg, 1), UBound(Plg, 2)) = Plg
Application.ScreenUpdating = True
End Sub
à bientôt