Bonjour,
J'ai un fichier avec plusieurs colonnes de filtre et j'ai une macro qui a pour but de ne me garder que les cellules avec les valeurs "yes".
Lorsque je lance ma macro, sur certains fichiers j'obtiens ce que je veux et sur d'autres non.
Voici mon code ainsi que mon fichier sur lequel appliquer le code.
Option Explicit
Sub KeepYes()
Dim dlig&, lig&, col%, vx As Variant
dlig = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
Rows(3 & ":" & dlig).Hidden = -1
For lig = 3 To dlig
For col = 1 To 158 ' colonne FB
vx = Cells(lig, col)
If VarType(vx) = 8 Then
If vx = "yes" Then Rows(lig).Hidden = 0: Exit For
End If
Next col
Next lig
End Sub
Sub ShowAllLigs()
Rows.Hidden = False
End Sub
Merci de votre aide.