Boucle avec condition

Bonjour à tous

Le code suivant ne fonctionne pas , si quelqu'un à une idée sur le dysfonctionnement ou les dysfonctionnements du code ...

Application.ScreenUpdating = False

With Sheets("Feuil1")
i = 2
    Do While Cells(i, 1) <> ""
       If .RangeCells(i, 7).Value Like "*E*" Then
       .RangeCells(i, 16) = "toto"
       ElseIf .RangeCells(i, 7).Value Like "*D*" Then
        .RangeCells(i, 16) = "tata"
        End If

    i = i + 1
    Loop

End With

Application.ScreenUpdating = True

Merci pour votre aide.

Greg

Salut,

Je ne connais pas le .rangecells...

Le code suivant fonctionne pour moi :

Application.ScreenUpdating = False

With Sheets("Feuil1")
i = 2
    Do While Cells(i, 1) <> ""
       If Cells(i, 7).Value Like "*E*" Then
       Cells(i, 16) = "toto"
       ElseIf Cells(i, 7).Value Like "*D*" Then
        Cells(i, 16) = "tata"
        End If

    i = i + 1
    Loop

End With

Application.ScreenUpdating = True

Pour info, la fonction like est sensible aux accents et aux majuscules.

Merci Girodo,

j'ai craqué avec mon ".rangecells" et merci pour l'info sur le like , je savais pas!!

encore merci et bonne journée

Greg

Rechercher des sujets similaires à "boucle condition"