View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Wiss Don Wiss is offline
external usenet poster
 
Posts: 300
Default Setting size of comment under macro control?

On Sat, 19 Nov 2005, Norman Jones wrote:

See Debra Dalgleish at:

http://www.contextures.com/xlcomments03.html#Resize


Thanks. This is what I ended up with:

Sub AddComment(S As String, R As Integer, C As Integer)
' puts properly sized comment in cell. sheet must be selected.
' arg: S - comment string
' R,C - row and column of cell

With Cells(R, C)
.ClearComments
.AddComment
With .Comment
.Text S
With .Shape
.TextFrame.AutoSize = True
If .Width 300 Then
.Width = 200
.Height = ((.Width * .Height) / 200) * 1.2
End If
End With
End With
End With

End Sub