Hello
J'ai une petite problématique. J'ai une feuille pour chaque ligne en colonne I, une liste de selection "Y/N".
J'ai créé 2 boutons, pour:
* bouton 1 > masquer toutes les lignes dont la case I est sur "N"
* bouton 2 > Afficher toutes les lignes qui sont masqués
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
DebutLgn = 14
FinLgn = 740
Valeur = 9
For NbLgn = DebutLgn To FinLgn
If Cells(NbLgn, Valeur).Value = 0 Then
Cells(NbLgn, Valeur).EntireRow.Hidden = True
End If
Next NbLgn
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
DebutLgn = 14
FinLgn = 740
Valeur = 9
For NbLgn = DebutLgn To FinLgn
If Cells(NbLgn, Valeur).EntireRow.Hidden = True Then
Cells(NbLgn, Valeur).EntireRow.Hidden = False
End If
Next NbLgn
Application.ScreenUpdating = True
End Sub
J'ai 2 "soucis":
> Ce processus est un peu long à traiter: y a t-il moyen d'optimiser le code?
> Je souhaiterai intégrer tout cela sur un seul bouton pour masquer/afficher
Une idée de comment m'y prendre?
Merci