Private Sub CommandButton1_Click() 'bouton Filtrer
Dim c1 As Range, c2 As Range
With [A1].CurrentRegion
.AutoFilter 10, .Cells(1, 10).Text
.AutoFilter 13, "<>" & Replace(.Cells(1, 13).Text, ",", ".")
If MsgBox("Voulez-vous mémoriser le filtrage dans 'Feuil Résultats' ?", 4, "Filtrer") = 7 Then Exit Sub
With Sheets("Feuil Résultats")
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
Set c1 = .Cells(.Rows.Count, 1).End(xlUp)(2)
Set c2 = .Cells(.Rows.Count, 13).End(xlUp)(2)
If c1.Row > c2.Row Then Set c2 = c1(1, 13)
If c1.Row < c2.Row Then Set c1 = .Cells(c2.Row, 1)
End With
On Error Resume Next 'si aucune SpecialCell
Intersect(.Columns(5), .Offset(1)).SpecialCells(xlCellTypeVisible).Copy c1
Intersect(.Columns(13), .Offset(1)).SpecialCells(xlCellTypeVisible).Copy c2
Application.Goto c1, True 'cadrage
End With
End Sub
Private Sub CommandButton2_Click() 'bouton RAZ
If FilterMode Then ShowAllData
End Sub