Modification de Code

Bonjour, Je n'arrive pas à modifier ce code:

Private Sub Worksheet_Activate()

    derLn = Range("A" & Rows.Count).End(xlUp).Row
    Range("D2:F" & derLn).ClearContents
    For i = 1 To 85
        For lgn = 2 To derLn
            With Sheets(Choose(i, "Janvier", "Fevrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Decembre") & " NUIT")
                Set cel = .Range("A5:A" & .Range("A" & Rows.Count).End(xlUp).Row).Find(Range("A" & lgn), lookat:=xlWhole)
                If Not cel Is Nothing Then
                    ln = cel.Row
                    For col = 3 To 33
                        If .Cells(ln, col).Value = "CA" Then
                            Cells(lgn, "D").Value = Cells(lgn, "D").Value + 1
                        ElseIf .Cells(ln, col).Value = "RTT" Then
                            Cells(lgn, "E").Value = Cells(lgn, "E").Value + 1
                        ElseIf .Cells(ln, col).Value = "RC" Then
                            Cells(lgn, "F").Value = Cells(lgn, "F").Value + 1
                        End If
                    Next col
                End If
            End With
        Next lgn
    Next i

Sachant que la variable "NUIT" peut être "NUIT","HC","HEMOSTASE","OP","SECRETAIRE","IDE","ARC"

Merci,

Bonjour,

Pourquoi i ... va jusqu'à 85 ... alors qu'il n' y a que ... 12 mois ...???

Bonjour,

Oui il y a 12 mois pour chacune des rubrique :"NUIT","HC","HEMOSTASE","OP","SECRETAIRE","IDE","ARC"

Re,

Pourquoi i ... va jusqu'à 85 ... alors qu'il n' y a que ... 12 mois ...???

il y a 12 mois pour chacun de poste:Bonjour,

Oui il y a 12 mois pour chacune des 7 rubriques :"NUIT","HC","HEMOSTASE","OP","SECRETAIRE","IDE","ARC"

12x7=84

Rechercher des sujets similaires à "modification code"