reset comment anchor when editing...

sadams1

Board Regular
Joined
Aug 19, 2006
Messages
139
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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

StephenCrump

MrExcel MVP
Joined
Sep 18, 2013
Messages
4,124
Office Version
  1. 365
Platform
  1. Windows
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?
 

Watch MrExcel Video

Forum statistics

Threads
1,129,793
Messages
5,638,360
Members
417,023
Latest member
Zimbo38

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
Top