1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private Sub CommandButton1_Click()
Dim i As Long, j As Long
Application.ScreenUpdating = False
With Sheets("Feuil2")
.Range("A2:I" & .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row).ClearContents
End With
With Sheets("Feuil1")
j = 2
For i = 7 To .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row
If .Range("A" & i).Value = .Range("A3").Value And .Range("B" & i).Value = .Range("B3").Value And .Range("C" & i).Value >= .Range("C3").Value And .Range("C" & i).Value <= .Range("D3").Value Then
.Rows(i).Copy Sheets("Feuil2").Range("A" & j)
j = j + 1
End If
Next i
End With
Application.ScreenUpdating = True
End Sub |
Partager