How to assign macro to click event on a notetext (comment)

sach44

New Member
Joined
Jan 3, 2016
Messages
11
I would like to catch the click event on a notenext/comment. However, the "Assign macro" option is greyed out in the context menu. Has anyone found a way to to this? How?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
What is a: notenext/comment

Do you mean a cell comment?

Yes, a cell comment. In VBA, both the .NoteText and .Comment properties can be used as shown below in this snippet. My .OnAction = "ShapeClick" 'Causes error 1004 attempt fails.

Code:
                  Cells(1, 18).NoteText Text:="test"
                  With Cells(1, 18).Comment.Shape
                        .TextFrame.Characters.Font.Name = "Arial"
                        .TextFrame.Characters.Font.Size = 12
                        .OnAction = "ShapeClick" 'Causes error 1004                    
                  End With
                    Cells(1, 18).Comment.Visible = True
 
Last edited:
Upvote 0
After searching, i beleive creating an actual shape which is not hooked as a comment in a range is required to assign the .OnAction
 
Last edited:
Upvote 0
A macro can be assigned to any shape and can also be assigned to any cell on a double click. But I have never heard of any way to assign a script to a cell comment.

If you need more help let me know.
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,947
Members
449,198
Latest member
MhammadishaqKhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top