1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Option Explicit
Option Base 1
Sub a_supprimer()
Dim derlg As Long, tb1, tb2(), x As Long, y As Long
With Sheets("Feuil1") 'à changer par le nom de ta feuille
derlg = .Range("A" & .Rows.Count).End(xlUp).Row ' si A est la colonne concernée
tb1 = .Range("A2:D" & derlg) 'si D est la dernière colonne et les données commencent en ligne 2
ReDim Preserve tb2(1 To derlg, 1 To 4) '4 pour colonne D
For x = 1 To UBound(tb1)
If Not UCase(tb1(x, 1)) Like "*A SUPPRIMER*" Then
y = y + 1
tb2(y, 1) = tb1(x, 1): tb2(y, 2) = tb1(x, 2): tb2(y, 3) = tb1(x, 3): tb2(y, 4) = tb1(x, 4)
End If
Next x
.Range("A2:D" & derlg) = tb2
End With
End Sub |
Partager