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
| Dim ok as boolean
Set Plage = Fl2.Range("DR4:DR" & Fl1.Range("DR4").End(xlDown).Row)
For Each Cell In Plage
If Cell.Offset(0, 0) = d2 Then
'vérifie la date'
If d = "Tous" Then
'vérifie le département, premierement si egal à tous, tous étant la valeur par défaut pour afficher tous les départements'
If Cell.Offset(0, -43) > 0 Then
ok = true
Laval = Laval + Cell.Offset(0, -43)
'additionne le nombre de fte si fte>0'
If Cell.Offset(0, -101) = 1 Then
valm = valm + 1
End If
'je dois aussi afficher les fte par sexe 1=m 2=f
If Cell.Offset(0, -101) = 2 Then
valf = valf + 1
End If
End If
End If
If Cell.Offset(0, -34) = d Then
'si département égal combobox'
If Cell.Offset(0, -43) > 0 Then
Laval = Laval + Cell.Offset(0, -43)
'si fte>0 on aditionne les fte'
'par sexe'
If Cell.Offset(0, -101) = 1 Then
valm = valm + 1
End If
'par sexe'
If Cell.Offset(0, -101) = 2 Then
valf = valf + 1
End If
if ok then exit for
End If
End If
End If
Next
ok = false
Worksheets("Feuil1").Range("G8").Offset(1, 2) = Laval
Worksheets("Feuil1").Range("K8").Offset(1, 0) = valm
Worksheets("Feuil1").Range("K8").Offset(1, 2) = valf
Laval = 0
valm = 0
valf = 0 |
Partager