L
lili13
Guest
Comme prévu je joint les lignes VBA concerné par l'intermédiare de ce fichier ZIP.
Merci à tous.
Merci à tous.
[file name=FichierJointAddCommetnErreur.zip size=809]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/FichierJointAddCommetnErreur.zip[/file]Comme prévu je joint les lignes VBA concerné par l'intermédiare de ce fichier ZIP.
Merci à tous.
Worksheets('DELEGATION').Unprotect ('TaTa')
Option Explicit
Private Const PSW As String = 'TaTa'
Private Sub CommandButton1_Click()
Dim Commentaire As String
With Worksheets('DELEGATION')
.Unprotect PSW
If ActiveCell.Locked = True Then
MsgBox 'Vous devez choisir une cellule dans la zone de sélection uniquement ! ', _
vbInformation + vbOKOnly, 'DELEGATION GEL'
' Semble inutile et source de plantage selon feuille où l'on se trouve...
'.Range('C11:E15').Select
'.Protect PSW
Exit Sub
Else
Commentaire = InputBox('Entrez votre commentaire ici !', _
'DELEGATION COMMENTAIRE', 'Votre commentaire')
If Commentaire = '' Then
MsgBox 'Aucun commentaire n'a été ajouté à la cellule ! ', _
vbInformation + vbOKOnly, 'DELEGATION '
.Protect PSW
Exit Sub
Else
.Activate
.Unprotect PSW
With ActiveCell
If Not .Comment Is Nothing Then .ClearComments
.AddComment Commentaire
End With
.Protect PSW
MsgBox 'Commentaire : ' & Commentaire & vbCrLf & vbCr _
& ' ajouté avec succés ! ', _
vbInformation + vbOKOnly, 'DELEGATION COMMENTAIRE'
End If
End If
End With
End Sub