Can I move the Comment Box?

gord9b

Board Regular
Joined
Jun 12, 2002
Messages
249
When certain cells in the worksheet are selected, a comment box pops up to advise what is to be entered and in what format. This box obstructs other cells that I want displayed. Is there any way to move this comment box to be centered to the right of the cell, or centered to the left of the cell selected?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
This code anchors the comment to the bottom left corner of the cell, provided that no indicator is shown. Maybe you can adapt it to position the comments wher you want them:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim c As Object
    For Each c In Target.Parent.Comments
        c.Visible = False
    Next
    On Error GoTo NoComment
    Target.Comment.Shape.Visible = True
    Target.Comment.Shape.Left = Target.Left - Target.Comment.Shape.Width
    Target.Comment.Shape.Top = Target.Top + Target.Height
    Exit Sub
NoComment:
End Sub

To enable the code right click the sheet tab and choose View Code. Paste it into the window on the right. Press Alt+F11 to return to your worksheet.
 
Upvote 0
Only if you choose the option to "Show Comment", which will show it even when you are not hovering over or selecting the cell it is in.

To do this, select the cell that the comment is in and right-click. Choose "Show Comment" from the drop-down menu. then, left-click on the comment, place the cursor on the border of the comment and drag it to where ever you want. Resize if necessary.
 
Upvote 0
Hi all, try this code friend

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

By changing the cmt.Shape.Top = cmt.Parent.Top + 5 and cmt.Parent.Offset(0, 1).Left + 5
we can move any where in the active sheet

i hope it help you.

Regards,
Mohammed Ali
http://daily-exceltips.blogspot.com
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,619
Members
449,039
Latest member
Mbone Mathonsi

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