vba to position comment boxes not working

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
683
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I have the following vba macro to re-position comment boxes on a worksheet but it's having no effect, would anyone have any ideas as to why that could be?
Many thanks,
VBA Code:
Sub ResetComments()
    
    Dim cmt As Comment
    
    For Each cmt In Sheet1.Comments
        cmt.Shape.Top = cmt.Parent.Top + 10
        cmt.Shape.Left = _
            cmt.Parent.Offset(0, 1).Left + 5
    Next
    
End Sub
 
Ah, there-in lies the problem and that accounts for what I was experiencing when I was playing with other comment box vba when trying to get it to work!!!
Well you've answered the query about the code I was using - many thanks for that :)
Ultimately I need a solution for changing the position of comments on mouse-over so I'll do some research and if I can't find anything (or a workaround that achieves the same end result) then I may re-post this with a more specific header & content.
Thanks again for your time and support with this :)
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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