1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
Private Sub Worksheet_Change(ByVal Target As Range)
'empêcher de faire scintiller l'écran pendant l'éxécution du programme
Application.ScreenUpdating = False
Dim plage As Range, C As Range, d As Range
ActiveSheet.Unprotect Password:="isped", DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingCells:=True, AllowFormattingRows:=True, AllowFormattingColumns:=True
'ActiveSheet.EnableSelection = xlUnlockedCells
' automatisation de la trame de base
'masquage des lignes vides lorsque le service n'est pas pourvu en fonction (IDE nuit, ASD)
Set plage = [a7: a100]
For Each C In plage
If C.Value = "0" Then
C.EntireRow.Hidden = True
Else
C.EntireRow.Hidden = False
End If
Next C
Set plage = Nothing
'masquage de Colonnes pour respect de la longueur des mois (calendrier)
'(doit être associé àune formule conditionnelle =SI(AD6<>"";SI(MOIS(AD6)=MOIS(AD6+1);AD6+1;"");"")
Set plage = Range("AD5:AF5")
For Each d In plage
If d.Value = "" Then
d.EntireColumn.Hidden = True
Else
d.EntireColumn.Hidden = False
End If
Next d
Set plage = Nothing
Columns("AG").EntireColumn.Hidden = True
Sheets("TRAME").Protect Password:="isped", DrawingObjects:=False, Contents:=False, Scenarios:=False, AllowFormattingCells:=False, AllowFormattingRows:=False, AllowFormattingColumns:=False
End Sub |
Partager