reset comment anchor when editing...

sadams1

Board Regular
Joined
Aug 19, 2006
Messages
219
I've got the following code to reset the position when hovering over a comment:


Sub ResetComments()
Dim pComment As Comment
For Each pComment In Application.ActiveSheet.Comments
pComment.Shape.Top = pComment.Parent.Top + 5
pComment.Shape.Left = pComment.Parent.Offset(0, 1).Left + 5
Next
End Sub



However, when hovering over a comment, then right-clicking to "edit comment", the comment box jumps across the screen.
Is is possible to reset this editing part to keep it in the same position as when just hovering over it?

Thanks!
Steve
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
It's not clear how you're calling ResetComments, or how you (presumably) put the comments back in their correct places. (And also why you loop through all comments, rather than just move the one you're hovering over).

There may be other ways to approach it, depending on how you've coded it, but I'd suggest first trying to use the Worksheet_BeforeRightClick event to temporarily keep the comment in position for editing?
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

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