VBA: Supprimer ligne si contient XY col A
Résolu
Lolo
-
Lolo -
Lolo -
Hello,
Auriez vous une manière simple de faire une macro sous excel qui supprime toutes les lignes qui contiennent "xy" en colonne A ?
Merci beaucoup
Auriez vous une manière simple de faire une macro sous excel qui supprime toutes les lignes qui contiennent "xy" en colonne A ?
Merci beaucoup
A voir également:
- VBA: Supprimer ligne si contient XY col A
- Excel compter cellule couleur sans vba - Guide
- Vba ouvrir un fichier excel avec chemin ✓ - Forum VB / VBA
- Incompatibilité de type vba ✓ - Forum VB / VBA
- Erreur 13 incompatibilité de type VBA excel ✓ - Forum Excel
- Vba récupérer valeur cellule ✓ - Forum VB / VBA
Sub Supprime_xy()
Dim Rng As Range
MotCh = InputBox("xy")
Set Rng = Feuil1.Cells.Find(MotCh)
If Rng Is Nothing Then Exit Sub
Rng.EntireRow.Delete
End Sub
Mais ça fonctionne pas :(
Dim i As Integer i = 1 Do While Cells(i, 1).Value <> "" If Cells(i, 1).Value = "xy" Then Cells(i, 1).Value = "" End If i = i + 1 LoopEn fait la boucle parcours toute les valeurs de la colone A jusqu'a ce qu'un champs soit vide.
Si ta colonne A est rempli à la suite sans vide ça devrait fonctionner
Dim i As Integer i = 1 Max = InputBox("Jusqu'a quel ligne faut-il aller ?", "Question") For i = 1 To Max If Cells(i, 1).Value = "xy" Then Cells(i, 1).Value = "" End If i = i + 1 Next iLa seconde me met une erreur de compilation sur
toto = InputBox("Jusqu'a quel ligne faut-il aller ?", "forum Access")
Merci beaucoup !
Bonne journée !