#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default comment function

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default comment function

try
Function Comment(MyCell)
Comment = MyCell.Comment.text
End Function


"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

  #3   Report Post  
Posted to microsoft.public.excel.misc
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot empty clipboard" MartinShort Excel Discussion (Misc queries) 9 July 14th 06 10:01 AM
VBA Monty Excel Worksheet Functions 2 January 30th 06 01:37 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 06:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"