Sub Comparaison()
Application.ScreenUpdating = False
Dim x As Long
Dim y As Long
Dim limite As Long
Dim MaValeur, nbcell
Dim plage As Range
Dim Cel As Range
Dim n As Long
Dim cell As Range
Dim dest As Range
y = Range("A65536").End(xlUp).Row + 1
For x = 3 To y
If (Cells(x, "M") <> 0) Then
If (Cells(x, "U") <> 0) Then Cells(x, "AG") = "Pas D'Erreur" Else Cells(x, "AG") = "Erreur"
Else
Cells(x, "AG") = "Pas D'Erreur"
End If
If (Cells(x, "N") <> 0) Then
If (Cells(x, "V") <> 0) Then Cells(x, "AH") = "Pas D'Erreur" Else Cells(x, "AH") = "Erreur"
Else
Cells(x, "AH") = "Pas D'Erreur"
End If
If (Cells(x, "O") <> 0) Then
If (Cells(x, "W") <> 0) Then Cells(x, "AI") = "Pas D'Erreur" Else Cells(x, "AI") = "Erreur"
Else
Cells(x, "AI") = "Pas D'Erreur"
End If
If (Cells(x, "P") <> 0) Then
If (Cells(x, "X") <> 0) Then Cells(x, "AJ") = "Pas D'Erreur" Else Cells(x, "AJ") = "Erreur"
Else
Cells(x, "AJ") = "Pas D'Erreur"
End If
If (Cells(x, "Q") <> 0) Then Cells(x, "AK") = "Pas D'Erreur" Else Cells(x, "AK") = "Erreur"
If (Cells(x, "R") <> 0) Then Cells(x, "AL") = "Pas D'Erreur" Else Cells(x, "AL") = "Erreur"
If (Cells(x, "S") <> 0) Then Cells(x, "AM") = "Pas D'Erreur" Else Cells(x, "AM") = "Erreur"
If (Cells(x, "T") <> 0) Then Cells(x, "AN") = "Pas D'Erreur" Else Cells(x, "AN") = "Erreur"
Next x
'jai pas compris ta boucle de 2 à 2 ?????
MaValeur = Range("AG2").Value
Range("AG2").Value = MaValeur + "Erreur Pour ParcN"
Range("AH2").Value = MaValeur + "Erreur Pour ParcN-1"
Range("AI2").Value = MaValeur + "Erreur Pour ParcN-2"
Range("AJ2").Value = MaValeur + "Erreur Pour ParcN-3"
Range("AK2").Value = MaValeur + "Erreur Pour Parc"
Range("AL2").Value = MaValeur + "Erreur Pour Trn-1"
Range("AM2").Value = MaValeur + "Erreur Pour Trn-2"
Range("AN2").Value = MaValeur + "Erreur Pour Trn-3"
n = 0
For Each cell In Range("AG:AN")
Select Case cell.Value
Case "Erreur", "Erreur Pour ParcN", "Erreur Pour ParcN-1", "Erreur Pour ParcN-2", _
"Erreur Pour ParcN-3", "Erreur Pour Parc", "Erreur Pour Trn-1", "Erreur Pour Trn-2", _
"Erreur Pour Trn-3"
Set dest = Sheets("Feuil2").Range("A65536").End(xlUp).Offset(1, 0)
cell.EntireRow.Copy Destination:=dest
n = n + 1
End Select
Next
MsgBox "" & n & " Erreurs Trouvées."
MsgBox "Traitement terminé"
Application.ScreenUpdating = True
End Sub