Bonjour Dan,
Malheureusement je n'arrive pas à vous envoyez le fichier , J'ai un autre problème sur un algorithme qui calcule le cumul d'une table, l'algorithme que j'ai réalisé calcule seulement une seul colonne par contre moi je voulais calculer 3 colonne.
Sub calculatCumuleScrap()
On Error Resume Next
Dim ws As Worksheet
Dim VisRng As Range, c As Range
Dim StartRow As Long
Dim LastRow As Long
Set ws = Sheet4
With ws
LastRow = .Cells(.Rows.Count, "AM").End(xlUp).Row '<-- get last row with data in Column K
StartRow = 9 '<-- init value
' set visible range to only filtered cells in Column G
Set VisRng = .Range(Range("AM" & StartRow), Range("AM" & LastRow)).SpecialCells(xlCellTypeVisible)
StartRow = VisRng.Item(1).Row '<-- update first row in visible range
For Each c In VisRng
If c.Row = StartRow Then
.Range("AN" & c.Row) = .Range("AM:" & c.Row).Value
Else
.Range("AN" & c.Row).Formula = "=SUBTOTAL(9,AM" & StartRow & ":AM" & c.Row & ")"
End If
Next c
End With
On Error GoTo 0
End Sub