vba to position comment boxes not working

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
575
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
 

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
575
Office Version
  1. 2016
Platform
  1. Windows
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 :)
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,209
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,896
Messages
5,621,497
Members
415,844
Latest member
Reda Fouad Ramzy

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