View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Position of Comment

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

"kirkm" wrote in message
...

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