Re : Condition if
Bonjour Staple1600,
Effectivement pour rien... je pouvais à chaque fois conserver le i ! Suis-je si bête...
Petite question, y aurait-il moyen d'adapter le code pour que par exemple, s'il n'y a aucune valeur en E5, il n'efface pas le contenu de C5-D5-E5-F5 ???
Merci une nouvelle fois pour votre aide.
Thomas
Sub professeur()
Sheets("Données").Range("A1:CH2090").copy Sheets("AAA").Range("A1:CH2090")
Dim i As Long
For i = 4 To 2090
If Cells(i, 5) <> "AAA" Then Cells(i, 3).Resize(, 4).ClearContents
If Cells(i, 9) <> "AAA" Then Cells(i, 7).Resize(, 4).ClearContents
If Cells(i, 13) <> "AAA" Then Cells(i, 11).Resize(, 4).ClearContents
If Cells(i, 17) <> "AAA" Then Cells(i, 15).Resize(, 4).ClearContents
If Cells(i, 22) <> "AAA" Then Cells(i, 20).Resize(, 4).ClearContents
If Cells(i, 26) <> "AAA" Then Cells(i, 24).Resize(, 4).ClearContents
If Cells(i, 30) <> "AAA" Then Cells(i, 28).Resize(, 4).ClearContents
If Cells(i, 34) <> "AAA" Then Cells(i, 32).Resize(, 4).ClearContents
If Cells(i, 39) <> "AAA" Then Cells(i, 37).Resize(, 4).ClearContents
If Cells(i, 43) <> "AAA" Then Cells(i, 41).Resize(, 4).ClearContents
If Cells(i, 47) <> "AAA" Then Cells(i, 45).Resize(, 4).ClearContents
If Cells(i, 51) <> "AAA" Then Cells(i, 49).Resize(, 4).ClearContents
If Cells(i, 56) <> "AAA" Then Cells(i, 54).Resize(, 4).ClearContents
If Cells(i, 60) <> "AAA" Then Cells(i, 58).Resize(, 4).ClearContents
If Cells(i, 64) <> "AAA" Then Cells(i, 62).Resize(, 4).ClearContents
If Cells(i, 68) <> "AAA" Then Cells(i, 66).Resize(, 4).ClearContents
If Cells(i, 73) <> "AAA" Then Cells(i, 71).Resize(, 4).ClearContents
If Cells(i, 77) <> "AAA" Then Cells(i, 75).Resize(, 4).ClearContents
If Cells(i, 81) <> "AAA" Then Cells(i, 79).Resize(, 4).ClearContents
If Cells(i, 85) <> "AAA" Then Cells(i, 83).Resize(, 4).ClearContents
Next
End Sub