Bonjour à tous,

Aujourd'hui je bloque sur une boucle ou il y a un IF, ci dessous un extrait du code qui est dans ma boucle.

Je m'explique je boucle sur différences cellules et en fonction du résultat il faudrait que ça incrémente la première cellule vide de cette même ligne mais je n'arrive pas à voir comment faire

Si l'un de vous peux m'éclairer ce serait gentil.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
        If Cells(l, 3) > 0 And Cells(l, 3) > Cells(l, 5) And Cells(l, 3) > Cells(l, 7) And Cells(l, 3) > Cells(l, 9) And Cells(l, 3) > Cells(l, 11) And Cells(l, 3) > Cells(l, 13) And Cells(l, 3) > Cells(l, 15) And Cells(l, 3) > Cells(l, 17) And Cells(l, 3) > Cells(l, 19) And Cells(l, 3) > Cells(l, 21) And Cells(l, 22) <> Cells(l, 2) And Left(Cells(l, 2).Value, 3) <> Left(Cells(l, 22).Value, 3) Then
        Cells(l, 23) = Cells(l, 2)
        End If
 
        If Cells(l, 5) > 0 And Cells(l, 22) <> Cells(l, 4) And Cells(l, 23) <> Cells(l, 4) And _
        Left(Cells(l, 4).Value, 3) <> Left(Cells(l, 22).Value, 3) And Left(Cells(l, 4).Value, 3) <> Left(Cells(l, 24).Value, 3) Then
        Cells(l, 24) = Cells(l, 4)
        End If