Open a cell comment for editing

mark hansen

Well-known Member
Joined
Mar 6, 2006
Messages
534
Office Version
  1. 2016
Platform
  1. Windows
I have a process where I need the user to enter information into a cell, then add a comment. I can add a comment with default text, but the user needs to change the default comments every time.

I use the following to add the comment:

ActiveCell.AddComment
ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Text:="Default text" & Chr(10) & ""

What I would like to do is, using VBA right click on the Cell and select "Edit comment"

I tried something silly as ActiveCell.Comment.Edit, but of course that doesn't work

Can this be done, or should I settle on the users needing to right click in the cell and select "Edit Comment"?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
What happens if you do this?

Code:
[COLOR=#333333]ActiveCell.AddComment[/COLOR]
[COLOR=#333333]ActiveCell.Comment.Text Text:="Default text" & Chr(10) & ""
[/COLOR][COLOR=#333333]ActiveCell.Comment.Visible = True[/COLOR]
 
Upvote 0
Thanks for the help yky and Matt.

Making the comment visible (TRUE) will display it, but it remains up after editing. Thanks for the tip about double clicking. I found the SendKeys "+{F2}" options and it will work. I like to stay away from SendKeys when I can, but can't find anything else.

Thanks for help.
Mark
 
Upvote 0
Hi, how about using an input box to capture the default comment text - for example:

Code:
Dim s As String
s = InputBox("Enter your default text..")
ActiveCell.AddComment
ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Text:=s & Chr(10) & ""
 
Upvote 0
Making the comment visible (TRUE) will display it, but it remains up after editing.

Then, put "ActiveCell.Comment.Visible = False" in a Worksheet event such as SelectionChange or BeforeDoubleClick.
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

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