Bonjour Esteban, bonjour le forum,
Comment savoir si ça marche ou pas puisque tu n'as pas mis le code ni pour Oui ni pour Non ?!...
Pour moi ça marche! La preuve :
Sub RAZ()
ActiveSheet.Unprotect Password:="test"
For Each c In Cells.SpecialCells(xlCellTypeConstants, 23)
If c.Locked = False Then c.Value = Empty
Next c
ActiveSheet.EnableSelection = xlUnlockedCells
ActiveSheet.Protect Password:="test"
'##################################
' Message box
'##################################
Dim Rep
Rep = MsgBox("Voulez-vous continuez ?", vbYesNo + vbQuestion, "CONFIRMATION")
If Rep = vbYes Then
MsgBox "Oui"
Else
MsgBox "Non"
Exit Sub
End If
'###################################
End Sub
Sinon, le même code simplifié et plus conventionnel :
Sub RAZ()
Dim Rep
ActiveSheet.Unprotect Password:="test"
For Each c In Cells.SpecialCells(xlCellTypeConstants, 23)
If c.Locked = False Then c.Value = Empty
Next c
ActiveSheet.EnableSelection = xlUnlockedCells
ActiveSheet.Protect Password:="test"
If MsgBox("Voulez-vous continuez ?", vbYesNo + vbQuestion, "CONFIRMATION") = vbYes Then
MsgBox "Oui"
Else
MsgBox "Non"
End If
End Sub