[COLOR="DarkSlateGray"][B]Sub masquer()
Dim oSh As Object
For Each oSh In ThisWorkbook.Sheets
If oSh.Name <> "principale" Then oSh.Visible = False
Next oSh
End Sub
Sub démasquer()
Dim oSh As Object
For Each oSh In ThisWorkbook.Sheets
oSh.Visible = True
Next oSh
End Sub[/B][/COLOR]
Sub masquer_desmaquer()
Dim oSh As Object
For Each oSh In ThisWorkbook.Sheets
If oSh.Name <> "principale" Then oSh.Visible = Not oSh.Visible
Next oSh
End Sub
Oui, à condition qu'entre deux exécutions de la procédure une manipulation n'ait pas, par exemple, masqué une feuille sur deux...Bonjour perdinch, ROGER2327, le fil, le forum
On peut regrouper le tout en une seule macro
Code:Sub masquer_desmaquer() Dim oSh As Object For Each oSh In ThisWorkbook.Sheets If oSh.Name <> "principale" Then oSh.Visible = Not oSh.Visible Next oSh End Sub
La 1ère exécution de la macro masque les feuilles
La 2ème exécution de la macro démasque les feuilles