Sub test()
Dim i&
For i = Range("A65536").End(xlUp).Row To 1 Step -1
If Cells(i, 2).Value = 0 And Cells(i, 3).Value = 0 And Cells(i, 4).Value = 0 Then
Rows(i).Delete
End If
Next i
End Sub
Sub Supprimerligne_Efgé()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim i&, Plg As Range
With Sheets("Feuil2")
For i = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
If .Cells(i, 1).Value = "" And .Cells(i, 2).Value = "" Then _
Set Plg = Union(.Rows(i), IIf(Plg Is Nothing, .Rows(i), Plg))
Next i
If Not Plg Is Nothing Then Plg.Delete
End With
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Sub es()
Dim t(), t1(), x As Long, i As Long, y As Long
t = Feuil2.Range("a2:b" & Feuil2.Cells(Rows.Count, 1).End(xlUp).Row)
ReDim t1(1 To UBound(t), 1 To 2)
For i = 1 To UBound(t)
If t(i, 1) <> "" And t(i, 2) <> "" Then
x = x + 1
For y = 1 To 2: t1(x, y) = t(i, y): Next y
End If
Next i
Feuil2.[a2:b4000].ClearContents
Feuil2.[A2].Resize(x, 2) = t1
End Sub
Sub Copie()
Dim i&, Plg As Range
With Sheets("Feuil1")
Set Plg = .Range("A1:B1")
For i = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
If .Range("A" & i) < 10 Or .Range("A" & i) > 15 Then
If .Range("B" & i) < 1 Or .Range("B" & i) > 2 Then
Set Plg = Union(.Range("A" & i & ":B" & i), Plg)
End If
End If
Next i
End With
With Sheets("Feuil2")
.UsedRange.ClearContents
If Not Plg Is Nothing Then Plg.Copy .Range("A1")
.Activate
End With
End Sub
If .Range("A" & i) < .Range("D1").Value Or .Range("A" & i) > .Range("E1").Value Then
If .Range("B" & i) < .Range("F1").Value Or .Range("B" & i) > .Range("G1").Value Then
Private Sub CommandButton1_Click()
Dim I&, K&, MinA&, MaxA&, MinB&, MaxB&, T As Variant
K = 1
With Sheets("Feuil1")
MinA = .[d1]: MaxA = .[e1]
MinB = .[f1]: MaxB = .[G1]
T = .Range("A1:B" & .Cells(Rows.Count, 1).End(xlUp).Row)
For I = 2 To UBound(T, 1)
If (T(I, 1) < MinA Or T(I, 1) > MaxA) And _
(T(I, 2) < MinB Or T(I, 2) > MaxB) Then
K = K + 1
T(K, 1) = T(I, 1): T(K, 2) = T(I, 2)
End If
Next I
End With
Application.ScreenUpdating = False
Columns("A:B").Clear
Range("A1").Resize(K, UBound(T, 2)) = T
Application.ScreenUpdating = True
End Sub
Bonjour à tous
Pas très complexe :
VB:If .Range("A" & i) < .Range("D1").Value Or .Range("A" & i) > .Range("E1").Value Then If .Range("B" & i) < .Range("F1").Value Or .Range("B" & i) > .Range("G1").Value Then
Cordialement