Salut et bonne annéenoon à dit:bonjour
quand j'insere un commentaire dans une cellule j'aimerais que ce commentaire soit renvoyé dans une cellule ou tout mes commentaires de différentes autres cellules se retrouve
merci
Option Explicit
Dim Target_1 As Range
Dim Txt_Comment As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim C
Dim Str_Comm As String
If Not (Target_1 Is Nothing) Then
If Target_1.Comment Is Nothing Then
If Txt_Comment <> "" Then GoTo MAJ_Comm
Else
If Target_1.Comment.Text <> Txt_Comment Then GoTo MAJ_Comm
End If
End If
Memorisation:
Set Target_1 = Target
If Target_1.Comment Is Nothing Then
Txt_Comment = ""
Else
Txt_Comment = Target_1.Comment.Text
End If
Exit Sub
MAJ_Comm:
For Each C In ActiveSheet.Comments
Str_Comm = IIf(Str_Comm = "", C.Text, Str_Comm & Chr(10) & Chr(10) & C.Text)
Next C
Range("A1") = Str_Comm
GoTo Memorisation
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim C
Dim Str_Comm As String
If Not (Target_1 Is Nothing) Then
If Target_1.Comment Is Nothing Then
If Txt_Comment <> "" Then GoTo MAJ_Comm
Else
If Target_1.Comment.Text <> Txt_Comment Then GoTo MAJ_Comm
End If
End If
Memorisation:
Set Target_1 = Target
If Target_1.Comment Is Nothing Then
Txt_Comment = ""
Else
Txt_Comment = Target_1.Comment.Text
End If
Exit Sub
MAJ_Comm:
For Each C In ActiveSheet.Comments
If Str_Comm <> "" Then Str_Comm = Str_Comm & Chr(10) & Chr(10)
Str_Comm = Str_Comm & C.Parent.Address(0, 0) & Chr(10) & C.Text
Next C
Range("A1") = Str_Comm
GoTo Memorisation
End Sub