Private Sub OK_Click()
If Controls("Login") = "" Then
MsgBox "Vous devez ABSOLUMENT indiquer votre login !", vbExclamation, _
"ERREUR ... Login SVP !"
Controls("login").SetFocus
Exit Sub
End If
If Identification.Login = "be" Then
ActiveSheet.Unprotect
With Range("X5:AJ5000")
.Locked = True
.FormulaHidden = True
End With
Range("A5:W5000").Locked = False
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowInsertingRows:=True, _
AllowInsertingHyperlinks:=True, AllowDeletingRows:=True, AllowSorting:= _
True, AllowFiltering:=True, AllowUsingPivotTables:=True
Range("A5").Select
Unload Identification
ElseIf Identification.Login = "prod" Then
ActiveSheet.Unprotect
With Range("A5:W5000")
.Locked = True
.FormulaHidden = True
End With
Range("X5:AJ5000").Locked = False
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowInsertingRows:=True, _
AllowInsertingHyperlinks:=True, AllowDeletingRows:=True, AllowSorting:= _
True, AllowFiltering:=True, AllowUsingPivotTables:=True
Range("X5").Select
Unload Identification
Else
MsgBox "Vous devez ABSOLUMENT indiquer votre login !", vbExclamation, _
"ERREUR ... Login SVP !"
Controls("login").SetFocus
Exit Sub
End If
End Sub