Position of comment when .visible = False does not seem to work

RustyNC

New Member
Joined
Jan 10, 2011
Messages
6
I am trying to change the position of a comment box.

I can successfully change the position when .visible = True, but when I set .visible = False the comment pops up on mouse-over and is not in the desired position.

Code:
Sub Comment_Move_Position()
    Dim dbl_X As Double
    Dim dbl_Y As Double
 
    With ActiveSheet.Range("J10")
        ' get position of cell
        dbl_X = .Left
        dbl_Y = .Top
        ' format as European date
        .NumberFormat = "dd/mm/yyyy;@"
        .HorizontalAlignment = xlCenter
        ' give this cell a comment
        .AddComment
        With .Comment
            ' comment text to be added
            .Text Text:= _
                "Sometimes comments can be useful"
            ' position comment box based on cell position
            With .Shape
                ' x and y of cell/range were set above
                .Left = dbl_X + 100
                .Top = dbl_Y - 100
            End With
            ' comment becomes visible on mouse-over when set to False
            ' when set to True comment remains visible
            .Visible = False
        End With
    End With
End Sub

Is it possible to change the comment position when the comment is hidden so when it pops up it will be in something other than the default location?

Using Excel 2010 on Windows 7

Cheers,
Rusty
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,586
Messages
6,179,718
Members
452,939
Latest member
WCrawford

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