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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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