Sub Macro1()
application.screenupdating=false
'
' Macro1 Macro
'
With Sheets("Règle Ségrégation")
.Cells.AutoFilter
End With
'
fin = Range("A" & Rows.Count).End(xlUp).Row
FinRègle = Sheets("Règle Ségrégation").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To fin
critère = Range("A" & i)
With Sheets("Règle Ségrégation")
.Range("$A$1:$H$" & FinRègle).AutoFilter
.Range("$A$1:$H$" & FinRègle).AutoFilter Field:=5, Criteria1:=critère
On Error Resume Next
.Range("G4:G" & FinRègle).SpecialCells(xlCellTypeVisible).Copy
End With
'Sheets("cas 2").Select 'ne sert à rien
Range("F" & i).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Next i
End Sub
application.screenupdating=true