Help with cell notes.

D

Dab

Help with cell notes.

Is there a way to get the contents for a cell note from somewhere else in
the sheet?

I'd like to make a 'lookup table' to generate the note contents. Let me
know. Thanks.
 
D

Dave Peterson

here's one of those VBA solutions.

Option Explicit
Function PutComment(myStr As String, TCell As Range) As Variant
Application.Volatile

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

TCell.AddComment Text:=myStr
End With

PutComment = ""

End Function


Then you can use a formula like:

=putcomment(VLOOKUP(A1,Sheet2!a:e,2,false),B9)

This matches the value in A1 in Sheet2, column A. It returns the second column
and plops it into a comment in B9.

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