Un bug dans mon code vba

nicolas -  
 nicolas -

Bonjour,

du coup j'ai fait un petit programme pour filtrer des ligne ou j'ai la colonne  Y = 0

du coup le problème c'est que quand il trouve pas le 0 il bug 

vous pouvez m'aides svp

      With tmp.range("Y1:Y" & [Y65536].End(xlUp).Row)
         .Replace What:="0", Replacement:="", LookAt:=xlWhole
         .SpecialCells(xlCellTypeBlanks).EntireRow.Delete
            End With


Windows / Firefox 91.0

Windows / Firefox 91.0

2 réponses

  1. f894009 Messages postés 17417 Date d'inscription   Statut Membre Dernière intervention   1 717
     

    Bonjour,

    Soit vous traitez l'erreur ou ceci

    Sub test()
        nb = Application.CountIf(Columns("Y"), 0)
        If nb > 0 Then
            With Worksheets("feuil1").Range("Y1:Y" & [Y65536].End(xlUp).Row)
                .Replace What:="0", Replacement:="", LookAt:=xlWhole
                .SpecialCells(xlCellTypeBlanks).EntireRow.Delete
            End With
        End If
    End Sub
    
    0
  2. nicolas
     

    ça marche trés bien merci bcp monsieur

    0