Sub Nom()
ActiveSheet.Unprotect Password:="toto"
x = InputBox("Veuillez saisir un nouveau nom !", "Noms")
If x = "" Then
Select Case MsgBox("Vous devez saisir un nom !", vbOKOnly, "Noms")
Case vbOK
ActiveSheet.Protect DrawingObjects:=True, contents:=True, Scenarios:=True, Password:="toto"
Exit Sub
End Select
End If
Range("D2") = x
ActiveSheet.Protect DrawingObjects:=True, contents:=True, Scenarios:=True, Password:="toto"
End Sub