clique droite sur l'onglet "Historique" puis choisis l'option "visualiser le code"
colle le code ci-dessous
Private Sub Worksheet_Change(ByVal Target As Range)
'Macro Dan le 08/12/10
Dim a As Byte
Dim dlg As Integer
dlg = ActiveSheet.Cells.Find("*", LookIn:=xlValues, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If Not Intersect(Target, Range("A7:V" & dlg)) Is Nothing Then
For i = 7 To dlg
Range("W" & i) = WorksheetFunction.CountIf(Range("A" & i & ":V" & i), Range("W6"))
Range("X" & i) = WorksheetFunction.CountIf(Range("A" & i & ":V" & i), Range("X6"))
Next
End If
End Sub
en supposant que la 1ère ligne de formule soit remplie
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Lg%, Lg2%
Lg = Cells.Find("*", , , , xlByRows, xlPrevious).Row
Lg2 = Application.CountA(Range("w7:x" & Lg)) / 2 + 6
If Not Application.Intersect(Target, Range("a7:v" & Lg)) Is Nothing Then
If Lg > Lg2 Then Range("w7:x7").AutoFill Destination:=Range("w7:x" & Lg)
End If
End Sub