bonjour,
tu peux quand même utiliser les commentaires. Ajoute remplace la fonction MiseEnFormeReservation du Userform de réservation par celle-ci:
Private Function MiseEnFormeReservation(NomFeuille As String) As Boolean
Dim resultat As Boolean, FirstCel As String
'On Error GoTo fin
' Déprotéger la feuille
Call Protection(NomFeuille, False)
' Faire la mise en forme
With Sheets(NomFeuille)
' Inscrire le nom dans la première cellule
FirstCel = Left(MaPlage.Address, InStr(1, MaPlage.Address, ":") - 1)
.Range(FirstCel).Value = Me.ComboNomUtilisateur
With .Range(MaPlage.Address)
.Merge
.Interior.ColorIndex = CouleurUser
'.HorizontalAlignment = xlCenter
.HorizontalAlignment = xlCenterAcrossSelection
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
'Lignes ajouté *********************************
Sheets(NomFeuille).Range(FirstCel).AddComment Text:=Commentaire.Text
'***********************************************
End With
End With
resultat = True
fin:
MiseEnFormeReservation = resultat
' Protéger la feuille
Call Protection(NomFeuille, True)
End Function
et dans le code du userform de suppression:
Private Sub MiseEnFormeReservation(NomFeuille As String, Plage As String)
' Déprotéger la feuille
Call Protection(NomFeuille, False)
' Faire la mise en forme
With Sheets(NomFeuille).Range(Plage)
.ClearContents
.Interior.ColorIndex = xlNone
.HorizontalAlignment = xlLeft
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
' Ligne ajoutée********************************
.ClearComments
' *********************************************
End With
' Protéger la feuille
Call Protection(NomFeuille, True)
End Sub