Bonjour a tous et a toutes
j'aimerais savoir s'il y a un moyen d’améliorer ce code
Sub Tri()
Dim i, j, n, m As Integer
Dim DerLig As String
Application.ScreenUpdating = False
DerLig = Range("B" & Rows.Count).End(xlUp).Row
For i = 7 To DerLig
If Cells(i, 7) = 0 Then Cells(i, 7) = ""
If Cells(i, 8) = 0 Then Cells(i, 8) = ""
Next i
n = 0
m = 0
Cells(5, 7).Interior.ColorIndex = 2
Cells(5, 7) = ""
Cells(5, 8).Interior.ColorIndex = 2
Cells(5, 8) = ""
For i = 7 To DerLig
For j = 7 To DerLig
If Cells(i, 7) <> 0 Then
If Cells(i, 7) = Cells(j, 8) Then
Cells(i, 7) = ""
Cells(i, 7).Interior.ColorIndex = 4
n = n + 1
Cells(j, 8) = ""
Cells(j, 8).Interior.ColorIndex = 4
m = m + 1
End If
End If
Next j
Next i
Cells(5, 7).Interior.ColorIndex = 4
Cells(5, 7) = n
Cells(5, 8).Interior.ColorIndex = 4
Cells(5, 8) = m
Application.ScreenUpdating = True
End Sub
merci a ceux qui me donneront une idée