Correction pour boucler sur toutes les cellules

Bonjour,

Pourriez-vous m'aider à corriger ce code pour boucler sur toutes les cellules d'un tableau excel, actuellement il ne boucle que sur une seule ligne ?

Merci beaucoup

Set pl1 = Sheets("CODES").Range("A1").CurrentRegion 'définit la plage pl2
For colB = 2 To 4 'boucle 1 : sur les colonne B à E
    For Each celCol In Range(Cells(2, colB), Cells(Application.Rows.Count, colB).End(xlUp))
            If Left(Cells(2, colB), 2) = "15" Then
                Cells(2, colB).Value = "Paillon" & vbLf & Cells(2, colB).Value
            End If
            If Left(Cells(2, colB), 2) = "10" Then
                Cells(2, colB).Value = "Mousse" & vbLf & Cells(2, colB).Value
            End If
       Next celCol 'prochaine cellule de la boucle 2
 Next colB 'prochaine colonne de la boucle 1
 

Bonjour,

Une piste :

For colB = 2 To 4 'boucle 1 : sur les colonne B à D (E est la 5ème colonne, donc pas inclus)
        LigMax = Cells(Rows.Count, colB).End(xlUp).Row
    For Lig = 2 To LigMax
            If Left(Cells(Lig, colB), 2) = "15" Then Cells(Lig, colB).Value = "Paillon" & vbLf & Cells(Lig, colB).Value
            If Left(Cells(Lig, colB), 2) = "10" Then Cells(Lig, colB).Value = "Mousse" & vbLf & Cells(Lig, colB).Value
       Next Lig 'prochaine ligne (boucle 2)
 Next colB 'prochaine colonne (boucle 1)
Rechercher des sujets similaires à "correction boucler toutes"