1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Sub Tri()
Dim Lc As Long, Lr As Long, Ld As Long
Dim c As Range
With Worksheets("Feuil1") ' A ADPATER
Ld = .Cells(.Rows.Count, 1).End(xlUp).Row
Set c = .Range("A1:A" & Ld).Find("EN COURS", LookIn:=xlValues, Lookat:=xlWhole)
If Not c Is Nothing Then
Lc = c.Row
Set c = .Range("A"& Lc+1 &":A" & Ld).Find("RESOLUS", LookIn:=xlValues, Lookat:=xlWhole)
If Not c Is Nothing Then
Lr = c.Row
Set c = Nothing
.Range("A" & Lc + 1 & ":D" & Lr - 1).Sort Key1:=.Range("C" & Lc + 1), Order1:=xlAscending, Key2:=.Range("B" & Lc + 1), Order2:=xlAscending, Header:=xlYes
.Range("A" & Lr + 1 & ":D" & Ld).Sort Key1:=.Range("C" & Lr + 1), Order1:=xlAscending, Key2:=.Range("B" & Lr + 1), Order2:=xlAscending, Header:=xlYes
End If
End If
End With
End Sub |
Partager