Bonjour le forum
Je reviens à mon sujet de hier au soir
Tout fonctionne bien mais j'ai pensé à un truc
Lorsque je clique sur F2 pour afficher tous les onglets, lorsque j'enregistre les onglets sont masqués sur l'année en cours.
Peut-on à l'enregistrement faire masquer les cellules vides et les colonnes de G à I dans la macro ci-dessous au lieu de refaire un double clic?
Merci à vous
Cordialement
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Count > 1 Then Exit Sub
If Not Target.Comment Is Nothing Then
If Not Intersect(Target, [A2:A8]) Is Nothing Then
Call RegularisationsExplications
End If
If Target.Row = 2 And Target.Column = 6 And Target.Count = 1 Then
Application.ScreenUpdating = 0
For Each sh In Worksheets
sh.Visible = 1
Next sh
End If
End If
Range("A1").Select
End Sub
Autre macro
Sub RegularisationsExplications()
Application.ScreenUpdating = False
With ActiveSheet
.Unprotect
If .Columns("G:I").Hidden = True Then
.Columns("G:I").Hidden = False
Else: .Columns("G:I").Hidden = True
End If
For Each Cel In .Range("E12:E16,E18:E31,E41:E45,E47:E60,E70:E74,E76:E89,E99:E103,E105:E118")
If Cel = "" Then
Cel.EntireRow.Hidden = Not Cel.EntireRow.Hidden
End If
Next Cel
.Range("A1").Select
.Protect
End With
Application.ScreenUpdating = False
End Sub