ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Dynamic contents of commens box (https://www.excelbanter.com/excel-worksheet-functions/7180-dynamic-contents-commens-box.html)

AB

Dynamic contents of commens box
 
Hello,

Is there a way by which I can make the contents of a
comment box dynamic, i.e. based on the contents of one or
more cells in the spreadsheet?

My preference is for a worksheet function / formula rather
than a macro. If no such function exists then of course
I will settle for a macro.

Thanks for your help.

AB.

Frank Kabel

Hi
not possible with formulas. This would require an event proceure

"AB" wrote:

Hello,

Is there a way by which I can make the contents of a
comment box dynamic, i.e. based on the contents of one or
more cells in the spreadsheet?

My preference is for a worksheet function / formula rather
than a macro. If no such function exists then of course
I will settle for a macro.

Thanks for your help.

AB.


Dave Peterson

You could use a UDF (UserDefinedFunction).


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.

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

AB wrote:

Hello,

Is there a way by which I can make the contents of a
comment box dynamic, i.e. based on the contents of one or
more cells in the spreadsheet?

My preference is for a worksheet function / formula rather
than a macro. If no such function exists then of course
I will settle for a macro.

Thanks for your help.

AB.


--

Dave Peterson


All times are GMT +1. The time now is 07:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com