View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default comment function

Function show_comments(r As Range) As String
Dim cmt As Comment
show_comments = ""
Set cmt = r.Comment
If cmt Is Nothing Then
Exit Function
End If
show_comments = cmt.Text
End Function

Sadly, this is not very volitile. So if you put a comment in A1 after you
have entered =show_comments(A1) in another cell, nothing will happen until
the sheet gets re-calculated.
--
Gary''s Student


"BillyJ" wrote:

I'm trying to create a fucntion that references the comment in a cell. Below
is what I have but it's obviously flawed somehow but dont know how to fix it.
Any help? Many thanks in advance.

Function Comment(MyCell)
Comment = MyCell.Comments
End Function