Bonjour,
Un essai...
Il sera sûrement à adapter à ton fichier réel, car je suppose que tu as fourni un exemple lambda, loin, très loin de ton fichier initial...
Autoriser les macros à l'ouverture du fichier
Les codes : (Masquer, Démasquer)
Sub Garde_X()
Dim Cel As Range
Application.ScreenUpdating = False
Cells.EntireColumn.Hidden = False
For Each Cel In Range("F7:Q7")
If Intersect(Cel, Range("F7:Q52").SpecialCells(xlCellTypeConstants, 23).EntireColumn) Is Nothing Then
Cel.EntireColumn.Hidden = True
End If
Next Cel
End Sub
Sub Reset()
Application.ScreenUpdating = False
Cells.EntireColumn.Hidden = False
End Sub
Le fichier :