bonjour à tous
j'utilise le code suivant pour retirer la protection et afficher les menus et ça fonctionne très bien
je voudrais utiliser le même type de code mais cette fois uniquement pour accéder à une feuille du même classeur
comme mes compétences sont très limitées je vous remercie de bien vouloir vous pencher sur ce code
Kinel
Sub OK_Click()
If Application.CommandBars("Worksheet Menu Bar").Enabled = True Then
If Identification.TextBox1.Value = "mdp" Then
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingRows:=True
ActiveSheet.ScrollArea = "A1:N43"
Application.DisplayFullScreen = True
With Application
.CommandBars("Worksheet Menu Bar").Enabled = False
With .CommandBars("Standard")
.Enabled = False
.Visible = False
End With
End With
End If
Identification.Hide
Exit Sub
End If
If Application.CommandBars("Worksheet Menu Bar").Enabled = False Then
If Identification.TextBox1.Value = "mdp" Then
Application.DisplayFullScreen = False
With Application
.CommandBars("Worksheet Menu Bar").Enabled = True
With .CommandBars("Standard")
.Enabled = True
.Visible = True
End With
End With
ActiveSheet.Unprotect
ActiveSheet.ScrollArea = ""
End If
Identification.Hide
Exit Sub
End If
End Sub
j'utilise le code suivant pour retirer la protection et afficher les menus et ça fonctionne très bien
je voudrais utiliser le même type de code mais cette fois uniquement pour accéder à une feuille du même classeur
comme mes compétences sont très limitées je vous remercie de bien vouloir vous pencher sur ce code
Kinel
Sub OK_Click()
If Application.CommandBars("Worksheet Menu Bar").Enabled = True Then
If Identification.TextBox1.Value = "mdp" Then
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingRows:=True
ActiveSheet.ScrollArea = "A1:N43"
Application.DisplayFullScreen = True
With Application
.CommandBars("Worksheet Menu Bar").Enabled = False
With .CommandBars("Standard")
.Enabled = False
.Visible = False
End With
End With
End If
Identification.Hide
Exit Sub
End If
If Application.CommandBars("Worksheet Menu Bar").Enabled = False Then
If Identification.TextBox1.Value = "mdp" Then
Application.DisplayFullScreen = False
With Application
.CommandBars("Worksheet Menu Bar").Enabled = True
With .CommandBars("Standard")
.Enabled = True
.Visible = True
End With
End With
ActiveSheet.Unprotect
ActiveSheet.ScrollArea = ""
End If
Identification.Hide
Exit Sub
End If
End Sub