Fréquence d'absenteisme - Page 2

Résolu
Précédent
  • 1
  • 2
  1. julia Namor Messages postés 532 Statut Membre 33
     
    Tout est clair maintenant
    pour la premiere question j'avais fais une erreur sur l'écriture de la fonction , maintement en tirant vers le bas la cellule tout s'arrange: c'est tout simplement génial .

    Quant aux macros je commence à y voir plus clair sur la conception avec tes fichiers;

    Je peux cloturer maintement le post et mettre résolu;
    merci encore ccm81 et j'espére que tu resteras encore longtemps sur ce forum pour aiguiller des profanes comme moi:
    Bien cordialement
    0
  2. ccm81 Messages postés 11033 Statut Membre 2 434
     
    De rien

    En jetant un oeil sur mon code, je me suis aperçu qu'il intervenait la variable nbarr et que je n'en faisais rien (une scorie d'un premier jus certainement), donc en supprimant toutes ses occurrences, ça donne en plus léger

    Public Function nbtja(plage As Range, nmin As Long, nmax As Long)
    Dim cel As Range, total As Long, t, k As Long
    Application.Volatile
    total = 0
    For Each cel In plage
    t = Split(cel.Value, ",")
    For k = 0 To UBound(t)
    If t(k) >= nmin And t(k) <= nmax Then total = total + t(k)
    Next k
    Next cel
    nbtja = total
    End Function

    Public Function tja(c As Range) As Long
    Dim t, tot As Long, k As Long
    Application.Volatile
    tot = 0
    t = Split(c.Value, ",")
    For k = 0 To UBound(t)
    tot = tot + t(k)
    Next k
    tja = tot
    End Function

    Public Function nbja(plage As Range, nmin As Long, nmax As Long)
    Dim cel As Range, total As Long, t, k As Long
    Application.Volatile
    total = 0
    For Each cel In plage
    t = Split(cel.Value, ",")
    For k = 0 To UBound(t)
    If t(k) >= nmin And t(k) <= nmax Then total = total + 1
    Next k
    Next cel
    nbja = total
    End Function

    Bonne route
    0
Précédent
  • 1
  • 2