Connecting cell comment with the other cell
Connecting cell comment with the other cell
(OP)
I am trying to set text of the cell comment being dependent on some other cell in the worksheet. This technique is easily achievable for text boxes (Select text box and type cell address in the formula bar) but not as straight forward for the comments. Wonder if anybody knows if it's possible. Thanks!





RE: Connecting cell comment with the other cell
Since the comment is not really meant to be used in the same fashion, I do not think they made it possible, but I will take a look.
RE: Connecting cell comment with the other cell
Range("E12").Comment.Text Text:=Range("E13").Value
Where E12 has the comment, and E13 has the text you want in it.
Not sure on straight out insertion though.
RE: Connecting cell comment with the other cell
RE: Connecting cell comment with the other cell
Private Sub Worksheet_Change(ByVal Target As Range)
Range("C5").Comment.Text Text:=Range("C6").Value
End Sub
Change the ranges as described before. This will function, and update when you change something on the sheet. You can check it by editing the comment to be blank, then changing something on the sheet.
RE: Connecting cell comment with the other cell
=IF((D15>D16),"D15 is greater to D16","D15 is less than or equal to D16"
would show the first value in the cell if D15 was greater than D16.
Note this does not need a macro to run to show the correct text.
Peter Stockhausen
Senior Design Analyst (Checker)
Infotech Aerospace Services
www.infotechpr.net
RE: Connecting cell comment with the other cell
The last code I provided does not require a macro be run, but will update automatically, as the user uses the sheet. You will likely still have to enable macros to allow the VB code to run.
RE: Connecting cell comment with the other cell
RE: Connecting cell comment with the other cell
RE: Connecting cell comment with the other cell
I'm using Excel 2007 and
Private Sub Worksheet_Change(ByVal Target As Range)
did not work.
I had to use the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Is this due to Excel 2007?
RE: Connecting cell comment with the other cell
I have noticed small changes like that between versions, but find it strange that it happened within the same version. It is Microsoft though. ;)
RE: Connecting cell comment with the other cell
RE: Connecting cell comment with the other cell
RE: Connecting cell comment with the other cell
RE: Connecting cell comment with the other cell
Thanks for posting up the alternate, especially if it seems to work more consistently.