Create a Comment in a cell via a Worksheet function (not using macros)?

A

Android

Hi,

I am using the VLOOKUP function to populate a sheetX with data from another
sheetY in the same workbook.

Is it possible to take the text in a cell in sheetY and add it as a
"comment" for a cell in SheetX, using a workwheet function.

I know this can be dome via VBA, but i prefer to use a worksheet function if
possible.

Is this possible?

Android.
 
D

Dave Peterson

you could have a UDF (user defined function) to copy a comment from one cell to
another. It'll be written in VBA, but it can be called from a worksheet cell.

Option Explicit
Function EchoComment(FCell As Range, TCell As Range)

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

If FCell.Value = "" Then
'do nothing
Else
TCell.AddComment Text:=FCell.Value
End If
EchoComment = ""

End Function

Then I could put this in any cell:
=echocomment(sheety!a1,sheetz!b3)

in any old cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top