Sub Filtrer_Data()
Dim R As Range
Set sh = ActiveWorkbook.Worksheets("MENU LILIANE")
Set R = sh.Columns("b").Find("Produits", , xlValues, xlWhole, xlByRows, xlNext)
Do While Not R Is Nothing
If sr = "" Then sr = R.Address
Rng = R.Offset(1).Address
Set R = sh.Columns("b").Find("Produits", R, xlValues, xlWhole, xlByRows, xlNext)
sh.Sort.SortFields.Clear
sh.Sort.SortFields.Add Key:=sh.Range(Rng), Order:=xlDescending, SortOn:=xlSortOnValues
sh.Sort.SortFields.Add Key:=sh.Range(Rng).Offset(0, 2), Order:=xlDescending, SortOn:=xlSortOnValues
If R.Address = sr Then
Set Plage = sh.Range(Rng & ":D" & sh.UsedRange.Rows.Count)
Else
Set Plage = sh.Range(Rng & ":D" & R.Row - 2)
End If
sh.Sort.SetRange Plage
sh.Sort.Apply
sh.Sort.SortFields.Clear
sh.Sort.SortFields.Add Key:=sh.Range(Rng), Order:=xlAscending
sh.Sort.SortFields.Add Key:=sh.Range(Rng).Offset(0, 2), Order:=xlAscending, SortOn:=xlSortOnValues
If R.Address = sr Then
Set S = sh.Range(Rng & ":b" & sh.UsedRange.Rows.Count).Find("")
Else
Set S = sh.Range(Rng & ":b" & R.Row - 2).Find("")
End If
sh.Sort.SetRange sh.Range(Rng & ":D" & S.Row - 1)
sh.Sort.Apply
If R.Address = sr Then Set R = Nothing
Loop
End Sub