Position of Comment

  • Thread starter Thread starter kirkm
  • Start date Start date
K

kirkm

The default appears to be to the right of the little red triangle.

Is it possible to have it appear to the left of that, to avoid
horizontal scrolling to read it ?

Thanks - Kirk
 
AFAIK there is no way to change the "hover" position of a comment. However,
in a selection event, could move a comment to left of the cell if it would
otherwise appear off the right edge, but would need to select the cell to
trigger it. Eg, try this in the ThisWorkbook module (to cater for all sheets
in the wb)

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
Dim rt As Single
Dim cmt As Comment

Application.DisplayCommentIndicator _
= xlCommentIndicatorOnly

On Error Resume Next
Set cmt = Target(1).Comment

On Error GoTo errExit
If Not cmt Is Nothing Then
With ActiveWindow.VisibleRange
rt = .Cells(1, 1).Left + .Width
End With

If cmt.Shape.Width + 10 + Target.Offset(, 2).Left > rt Then
cmt.Shape.Left = Target.Left - cmt.Shape.Width - 5
cmt.Visible = True
End If
End If

errExit:
End Sub

Regards,
Peter T
 
AFAIK there is no way to change the "hover" position of a comment. However,
in a selection event, could move a comment to left of the cell if it would
otherwise appear off the right edge, but would need to select the cell to
trigger it. Eg, try this in the ThisWorkbook module (to cater for all sheets
in the wb)

That's *very* nice Peter, many thanks.

You hover over the comment - see it's off screen, click the cell and
bingo !

Brilliant !

Cheers - Kirk
 
You explained the workaround much better than I did :-)

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Comments 2
Positioning a Comment 1
comments 2
Using a different Comment Indicator symbol 1
Adding a value in the comment field (little red triangle)? 3
Comments 3
Clearing Comments 5
Question about Comments 2

Back
Top