XL 2016 optimiser un code

zakariamalki

XLDnaute Nouveau
Bonjour,
comment je peux optimiser ce code vba

Do While i <= f
Worksheets(2).Select
If Cells(i, 1) = "Youness JATTI" And Cells(i, 20) <= lundimanquant And Cells(i, 19) = "" Then
Worksheets(1).Select
c = Range("F23").Value
Range("F23").Value = c + 1
Worksheets(2).Select
ElseIf Cells(i, 1) = "Yousra EL ATTAOUI" And Cells(i, 20) <= lundimanquant And Cells(i, 19) = "" Then
Worksheets(1).Select
c = Range("D23").Value
Range("D23").Value = c + 1
ElseIf Cells(i, 1) = "Lamyae EL MAHMOUDI" And Cells(i, 20) <= lundimanquant And Cells(i, 19) = "" Then
Worksheets(1).Select
c = Range("C23").Value
Range("C23").Value = c + 1
ElseIf Cells(i, 1) = "Meryem FNADI" And Cells(i, 20) <= lundimanquant And Cells(i, 19) = "" Then
Worksheets(1).Select
c = Range("E23").Value
Range("E23").Value = c + 1
ElseIf Cells(i, 1) = "Adam NADIM HANBALI" And Cells(i, 20) <= lundimanquant And Cells(i, 19) = "" Then
Worksheets(1).Select
c = Range("G23").Value
Range("G23").Value = c + 1
End If
i = i + 1
Loop
 

Statistiques des forums

Discussions
312 361
Messages
2 087 632
Membres
103 616
dernier inscrit
Simone98