bonsoir le forum
j'utilise un userform pour verrouiller et déverrouiller une feuille
dans cet userform se trouve un bouton OK dont voici le code :
Sub Ok_Click()
If Application.CommandBars("Worksheet Menu Bar").Enabled = True Then
If Identification.TextBox1.Value = "ml" Then
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 = "ml" Then
Application.DisplayFullScreen = False
With Application
.CommandBars("Worksheet Menu Bar").Enabled = True
With .CommandBars("Standard")
.Enabled = True
.Visible = True
End With
End With
End If
Identification.Hide
Exit Sub
End If
End Sub
les deux commandes suivantes vont me permettre :
1. de protéger et de limiter la zone de travail
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingRows:=True
ActiveSheet.ScrollArea = "A1:N43"
2. d'ôter la protection et d'ouvrir la zone de travail
ActiveSheet.Unprotect
ActiveSheet.ScrollArea = ""
un membre du forum peux t il m'aider à placer ces deux commandes dans le code du bouton OK ?
merci de votre aide
Kinel
j'utilise un userform pour verrouiller et déverrouiller une feuille
dans cet userform se trouve un bouton OK dont voici le code :
Sub Ok_Click()
If Application.CommandBars("Worksheet Menu Bar").Enabled = True Then
If Identification.TextBox1.Value = "ml" Then
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 = "ml" Then
Application.DisplayFullScreen = False
With Application
.CommandBars("Worksheet Menu Bar").Enabled = True
With .CommandBars("Standard")
.Enabled = True
.Visible = True
End With
End With
End If
Identification.Hide
Exit Sub
End If
End Sub
les deux commandes suivantes vont me permettre :
1. de protéger et de limiter la zone de travail
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingRows:=True
ActiveSheet.ScrollArea = "A1:N43"
2. d'ôter la protection et d'ouvrir la zone de travail
ActiveSheet.Unprotect
ActiveSheet.ScrollArea = ""
un membre du forum peux t il m'aider à placer ces deux commandes dans le code du bouton OK ?
merci de votre aide
Kinel