Option Explicit
Sub TrieretVérifier()
Call Trier
Call Vérifier
End Sub
Sub Trier()
Dim DerL&, Lig&
DerL = Feuil3.Range("A" & Rows.Count).End(xlUp).Row
Feuil3.Range("A2:Z" & DerL).Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("B2")
End Sub
Sub Vérifier()
Dim DerL&, Lig&
DerL = Feuil3.Range("A" & Rows.Count).End(xlUp).Row
For Lig = 2 To DerL
If Cells(Lig, 12) = "" And Cells(Lig, 10) <> "" Then
With Cells(Lig, 12)
.Value = "Non communiqué"
.Font.Bold = True
.Font.ColorIndex = 3
End With
Else
With Cells(Lig, 12)
.Value = .Value
.Font.Bold = False
.Font.ColorIndex = 1
End With
End If
If Cells(Lig, 10) = "" And Cells(Lig, 12) <> "" Then
With Cells(Lig, 10)
.Value = "Non communiqué"
.Font.Bold = True
.Font.ColorIndex = 3
End With
Else
With Cells(Lig, 10)
.Value = .Value
.Font.Bold = False
.Font.ColorIndex = 1
End With
End If
Next Lig
Cells.Columns.AutoFit
Range("A1").Select
End Sub