View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Linking Cell Comments!

How about a userdefined function:

Option Explicit
Function EchoComment(FCell As Range) As Variant
Application.Volatile

With Application.Caller
If .Comment Is Nothing Then
'do nothing
Else
.Comment.Delete
End If

If FCell.Comment Is Nothing Then
'do nothing
Else
.AddComment Text:=FCell.Comment.Text
End If
End With

EchoComment = FCell.Value

End Function

You'd use it like this:

=echocomment(a1)

The value in A1 would appear in the cell and the comment would get copied, too.

The application.volatile is there to update the comments if you change them.
(Changing the comment won't make the function run, but it'll catch up with then
next recalculation.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

eijaz wrote:

IS there anybody who can help me thru

Dear all,

Suppose i have a workbook containing a worksheet, whose cells r linked to
another a worksheet in another workbook. now the problem is, i want to
transfer the comments textbox( Insert MenuComments) on the cells in the 1st
workbook to the linked cells in the other workbook.( the Comments Textbox
when you right-click & add a comment to the cells.) is it possible to link
comments, so that whatever comment i gv to the cell in the 1st workbook's
sheets can be automatically displayed to in the other workbook's
worksheet??

Is it possible to code this in VBA? Can anybody help with the code? I'll
tell you exactly why i want this.... the 1st workbook's worksheet in
question is a daily attendance sheet, where i add comments to the cells
having a text value of "A" for Absent e.g. "agent mark was absent bcos of
high fever". i just want the comments to show (or be linked just like the
cell values) in the (linked) Monthly attendance workbook.

Can anybody help?


--

Dave Peterson