Sub Diviser()
Macro 1
End Sub
Sub Multiplier()
Macro 0
End Sub
Sub Macro(operation As Byte)
Dim ncol%, tablo, i&, coef&, dat As Variant, j%, x$
ncol = 265 'colonnes A à JE
With Feuil1.UsedRange
tablo = .Resize(, ncol) 'matrice, plus rapide
For i = 2 To UBound(tablo)
coef = Int(Val(tablo(i, ncol - 1)))
If coef < 1 Then coef = 1
dat = tablo(i, ncol)
If IsDate(dat) Then dat = CDate(dat) Else dat = -1
For j = 2 To ncol - 4
If tablo(1, j) <= dat Then
x = CStr(tablo(i, j))
If IsNumeric(x) Then If operation Then tablo(i, j) = x / coef Else tablo(i, j) = x * coef
Else
Exit For
End If
Next j, i
'---restitution---
If .Parent.FilterMode Then .Parent.ShowAllData 'si la feuille est filtrée
.Resize(, ncol - 4) = tablo
End With
End Sub