1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Dim a As Long, derligne As Long, dercolonn As Long
Dim criteretime As Double
derligne = Sheets(ShtName).Cells(Rows.Count, 1).End(xlUp).Row
dercolonn = Sheets(ShtName).Cells(1, Columns.Count).End(xlToLeft).Column
choixsec = 10
criteretime = TimeSerial(Hour(Cells(a, 2)), Minute(Cells(a, 2)), (Second(Cells(a, 2)) - choixsec)) + (DateSerial(Year(Cells(a, 2)), Month(Cells(a, 2)), Day(Cells(a, 2))))
For a = 5 To derligne
Cells(a, dercolonn + 1) = Application.WorksheetFunction.SumIfs _
(Range(Cells(4, dercolonn), Cells(a, dercolonn)), _
Range(Cells(4, 2), Cells(a, 2)), _
">=" & criteretime)
Next a |
Partager