1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| Sub comptemois()
Application.ScreenUpdating = False
'
' Macro1 Macro
'
Dim i, j As Integer
Dim compteur As Integer
Dim eotp, eotp1 As Integer
Dim period, period1 As Integer
For k = 3 To 76
Sheets("TempsEOTPMOIS").Select
eotp = Cells(k, 2).Value
eotp1 = Cells(k + 1, 2).Value
For m = 3 To 39
period = Cells(2, m).Value
period1 = Cells(2, m + 1).Value
Sheets("Planning (2)").Select
compteur = 0
i = eotp + 1
Do While i < eotp1
j = period
Do While j < period1
If IsNumeric(Cells(i, j).Value) = False Then
If Cells(i, j).Value <> "CE01" And Cells(i, j).Value <> "CT02" And Cells(i, j).Value <> "CT04" And Cells(i, j).Value <> "CT10" And Cells(i, j).Value <> "EP03" And Cells(i, j).Value <> "ES01" And Cells(i, j).Value <> "ES02" And Cells(i, j).Value <> "ES03" And Cells(i, j).Value <> "ES04" And Cells(i, j).Value <> "MT01" And Cells(i, j).Value <> "RA01" And Cells(i, j).Value <> "RS02" And Cells(i, j).Value <> "RS03" Then
compteur = compteur + Cells(i + 1, j).Value
End If
End If
j = j + 1
Loop
i = i + 1
Loop
Sheets("TempsEOTPMOIS").Select
Cells(k, m).Select
ActiveCell.FormulaR1C1 = compteur
Next
Next
Application.ScreenUpdating = True
'
End Sub |
Partager