ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Comments Referencing Excel Formula (https://www.excelbanter.com/excel-programming/382625-excel-comments-referencing-excel-formula.html)

R Avery[_2_]

Excel Comments Referencing Excel Formula
 
I know that you can have TextBox objects in Excel which have
a .DrawingObject.Formula property that you can set programmatically
(or in the GUI) so that whenever you calculate the sheet, if the
underlying cell changes the textbox's text will also change.

Is this possible to do with Excel Comments? I have already tried to
Comment.Shape.DrawingObject.Formula, but it errors out, saying that
you cannot access that property. Is there any way to make the text of
a comment dynamically refer to the contents of a cell?


Gary Brown

Excel Comments Referencing Excel Formula
 
You can put a macro in the worksheet's Worksheet_Calculate() and change the
Comment text with something like this...

Private Sub Worksheet_Calculate()
Range("B2").Comment.Text Text:=Range("C4").Value
End Sub

Where B2 contains your comment and looks at the value in Cell C4.

--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"R Avery" wrote:

I know that you can have TextBox objects in Excel which have
a .DrawingObject.Formula property that you can set programmatically
(or in the GUI) so that whenever you calculate the sheet, if the
underlying cell changes the textbox's text will also change.

Is this possible to do with Excel Comments? I have already tried to
Comment.Shape.DrawingObject.Formula, but it errors out, saying that
you cannot access that property. Is there any way to make the text of
a comment dynamically refer to the contents of a cell?




All times are GMT +1. The time now is 05:52 AM.

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