A
avyrex1926
Guest
Bonjour à tous,
Dans ce code:
Je veux simplifier cette partie:
Toute les résultats sont maintenant inscrit dans la feuille "Base de données" range ("O2:O50").
Comment modifier cette partie du code s.v.p.
Merci pour votre aide.
Dans ce code:
Code:
Dim i As Long, Cumlig As Long, Jour As String, ColJour As Range
Dim cel As Range, PlageTest, z
Sheets("Trancheur").Rows("3:1000").Delete
'Première ligne d'affichage dans la feuille "Cumul de l'employé"
With Sheets(ComboBox13.Text)
Cumlig = 3
Jour = ComboBox14
'Boucle à partir de la ligne 6 dans la feuille "Base de donnée"
Set ColJour = .Range("E65536:Q65536").Find(Jour, LookIn:=xlValues)
If Not ColJour Is Nothing Then
For i = 6 To .Range("A" & Cells.Rows.Count).End(xlUp).Row
'Si la valeur de la colonne A correspond au nom sélectionné
If .Cells(i, 1) <> "" And .Cells(i, ColJour.Column) <> "" And .Cells(i, ColJour.Column) <> "0" And .Cells(i, ColJour.Column) <> "REGULIER" And .Cells(i, ColJour.Column) <> "VACANCE" And .Cells(i, ColJour.Column) <> "1JR_CSST" And .Cells(i, ColJour.Column) <> "ABS_M_NP" And .Cells(i, ColJour.Column) <> "ABS_NP" And .Cells(i, ColJour.Column) <> "ABS_M_NP" And .Cells(i, ColJour.Column) <> "ACC_CSST" And .Cells(i, ColJour.Column) <> "ACC_H_T" And .Cells(i, ColJour.Column) <> "ACT_GRACE" Then
'Copier les valeurs
Sheets("Trancheur").Cells(Cumlig, 1).Value = .Cells(i, 1).Value
Sheets("Trancheur").Cells(Cumlig, 2).Value = .Cells(i, 2).Value
Sheets("Trancheur").Cells(Cumlig, 5).Value = .Cells(i, ColJour.Column).Value
Sheets("Trancheur").Cells(Cumlig, 6).Value = .Cells(i + 1, ColJour.Column).Value
'Ligne suivante pour l'affichage
Cumlig = Cumlig + 1
End If
Next i
End If
Sheets("Trancheur").Range("E2") = Jour
End With
Je veux simplifier cette partie:
Code:
If .Cells(i, 1) <> "" And .Cells(i, ColJour.Column) <> "" And .Cells(i, ColJour.Column) <> "0" And .Cells(i, ColJour.Column) <> "REGULIER" And .Cells(i, ColJour.Column) <> "VACANCE" And .Cells(i, ColJour.Column) <> "1JR_CSST" And .Cells(i, ColJour.Column) <> "ABS_M_NP" And .Cells(i, ColJour.Column) <> "ABS_NP" And .Cells(i, ColJour.Column) <> "ABS_M_NP" And .Cells(i, ColJour.Column) <> "ACC_CSST" And .Cells(i, ColJour.Column) <> "ACC_H_T" And .Cells(i, ColJour.Column) <> "ACT_GRACE" Then
Toute les résultats sont maintenant inscrit dans la feuille "Base de données" range ("O2:O50").
Comment modifier cette partie du code s.v.p.
Merci pour votre aide.
Dernière modification par un modérateur: