1 2 3 4 5 6 7 8 9 10 11 12 13 14
| Public Function effectif_1_critere(nom_critere As String, valeur_critere) As Integer
Sheets("Effectif").Select
Range("A1").Select
nbre_lig = Application.WorksheetFunction.CountA(Range("A1", [A1].End(xlDown)))
nbre_col = Application.WorksheetFunction.CountA(Range("A1", [A1].End(xlToRight)))
num_col_critere1 = num_col(nom_critere, nbre_col)
num_col_comptage = num_col("COMPTAGE", nbre_col)
effectif_1_critere = Application.WorksheetFunction.SumIf(Range(Cells(2, num_col_critere1), Cells(nbre_lig, num_col_critere1)), valeur_critere, Range(Cells(2, num_col_comptage), Cells(nbre_lig, num_col_comptage)))
End Function |
Partager