Private Sub Workbook_Open()
With Worksheets("Feuil1")
.EnableAutoFilter = True
.EnableOutlining = True
.Protect Contents:=True, Password:="Toto", UserInterfaceOnly:=True
End With
End Sub
Private Sub Workbook_Open()
Dim WS_Count As Integer
Dim I As Integer
WS_Count = ActiveWorkbook.Worksheets.Count
For I = 1 To WS_Count
With ActiveWorkbook.Worksheets(I)
.EnableAutoFilter = True
.EnableOutlining = True
.Protect Contents:=True, UserInterfaceOnly:=True
End With
Next I
End Sub
Bonjour Deadpool_CCun truc du genre devrait fonctionner
VB:Private Sub Workbook_Open() With Worksheets("Feuil1") .EnableAutoFilter = True .EnableOutlining = True .Protect Contents:=True, Password:="Toto", UserInterfaceOnly:=True End With End Sub
Private Sub Workbook_Open()
With Worksheets("HIVERS")
.EnableOutlining = True
.Protect Contents:=True, Password:="Toto", UserInterfaceOnly:=True
End With
End Sub
Bonsoir le forum
Bonsoir Quicksland, Deadpool_CC
Le code donné par notre ami Deadpool fonctionne comme il se doit (enfin sous XL2010 mais plus également je pense). Le code doit être placé dans ThisWorkBook et ne sera activé qu'à la prochaine ouverture du classeur.
Bonne soirée à toutes & à tousVB:Private Sub Workbook_Open() With Worksheets("HIVERS") .EnableOutlining = True .Protect Contents:=True, Password:="Toto", UserInterfaceOnly:=True End With End Sub
@+ Eric c
Bonsoir EricBonsoir le forum
Bonsoir Quicksland, Deadpool_CC
Le code donné par notre ami Deadpool fonctionne comme il se doit (enfin sous XL2010 mais plus également je pense). Le code doit être placé dans ThisWorkBook et ne sera activé qu'à la prochaine ouverture du classeur.
Bonne soirée à toutes & à tousVB:Private Sub Workbook_Open() With Worksheets("HIVERS") .EnableOutlining = True .Protect Contents:=True, Password:="Toto", UserInterfaceOnly:=True End With End Sub
@+ Eric c
Sub verrou()
Dim s As Worksheet
For Each s In Worksheets
p s
Next
End Sub
Private Sub p(ws As Worksheet)
ws.EnableOutlining = -1
ws.Protect , Contents:=True, AllowFiltering:=-1, UserInterfaceOnly:=-1
End Sub
Worksheets("Hivers").Outline.ShowLevels RowLevels:=2 ', ColumnLevels:=2 'Developpe le plan pour une action
'**** Ton action
Worksheets("Hivers").Outline.ShowLevels RowLevels:=1 ', ColumnLevels:=1 'Replie le plan apres l'action (pour remettre comme avant)
Bonsoir le forum
Bonsoir Quicksland, Deadpool_CC
Le code donné par notre ami Deadpool fonctionne comme il se doit (enfin sous XL2010 mais plus également je pense). Le code doit être placé dans ThisWorkBook et ne sera activé qu'à la prochaine ouverture du classeur.
Bonne soirée à toutes & à tousVB:Private Sub Workbook_Open() With Worksheets("HIVERS") .EnableOutlining = True .Protect Contents:=True, Password:="Toto", UserInterfaceOnly:=True End With End Sub
@+ Eric c
reRe le fil,
Bonsoir Philippe, Staple1600
Bizarre, je te mets ton fichier modifié (qui fonctionne chez moi).
@+ Eric c
Re...Re le fil,
Bonsoir Philippe, Staple1600
Bizarre, je te mets ton fichier modifié (qui fonctionne chez moi).
@+ Eric c
Private Sub Workbook_Open()
Dim WS_Count As Integer
Dim I As Integer
WS_Count = ActiveWorkbook.Worksheets.Count
For I = 1 To WS_Count
With ActiveWorkbook.Worksheets(I)
.EnableOutlining = True
.Protect Contents:=True, Password:="Toto", UserInterfaceOnly:=True
End With
Next I
End Sub
Merci pour ton aide si précieuseLe fil
Bien sûr, cela t'a été donné au post #3. Modifié :
VB:Private Sub Workbook_Open() Dim WS_Count As Integer Dim I As Integer WS_Count = ActiveWorkbook.Worksheets.Count For I = 1 To WS_Count With ActiveWorkbook.Worksheets(I) .EnableOutlining = True .Protect Contents:=True, Password:="Toto", UserInterfaceOnly:=True End With Next I End Sub
Ce code remplace le code placé dans ThisWorkBook.
Bonne soirée
@+ Eric c