Copy the content of a cell into a comment using a macro

nookwork Posted messages 4 Registration date   Status Member Last intervention   -  
Gyrus Posted messages 3360 Status Member -
Good evening everyone,

I really need your help. I'm working on an Excel file that I need to optimize as much as possible and I would need a macro to copy the content of a cell into a comment. I am a beginner in macros. Here’s what I found as a macro on the internet for inspiration, but I have never managed to do what I wanted with it:

Sub Add_Cell_Value_to_Comment()
Dim CelS As Range, CelDest As Range, OldCom As Variant

Set CelDest = ActiveSheet.Range("B6")

With CelDest
On Error Resume Next
.Comment.Delete
.AddComment
.Comment.Shape.TextFrame.AutoSize = True
.Comment.Text CStr(CelDest)
End With

End Sub

PS: If this can help...

I thank you in advance for any help you can provide.

Have a good evening everyone.

1 answer

  1. Gyrus Posted messages 3360 Status Member 526
     
    Hello,

    It's not enough to say that you can't do what you want.
    We must still know what you want to do...

    The macro you present copies the value of B6 into the comment area of that same cell.

    See you!
    0