Results 1 to 4 of 4

Can I move the Comment Box?

This is a discussion on Can I move the Comment Box? within the Excel Questions forums, part of the Question Forums category; When certain cells in the worksheet are selected, a comment box pops up to advise what is to be entered ...

  1. #1
    Board Regular
    Join Date
    Jun 2002
    Location
    Toronto, Ontario
    Posts
    214

    Default Can I move the Comment Box?

    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?

  2. #2
    MrExcel MVP
    Moderator
    Andrew Poulsom's Avatar
    Join Date
    Jul 2002
    Posts
    67,543

    Default

    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.

  3. #3
    Board Regular Barry Katcher's Avatar
    Join Date
    Feb 2002
    Location
    Dog Beach, Florida. Yeaahh!
    Posts
    4,055

    Default

    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.
    Barry-

    Photo Restoration/Enhancement

    http://www.smiledogproductions.com
    click below for detour


  4. #4
    New Member
    Join Date
    Mar 2010
    Posts
    4

    Post Re: Can I move the Comment Box?

    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

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com