Comments in cell (try #2)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Will someone offer some assistance with this pls,

Is it possible to have the result of this formula
=SUM(DynamicRange)/COUNTIF(DynamicRange,">0")displayed as a comment attached
to cell B1? The comment would need to continually update as dynamic data is
changing.

TIA
 
: Will someone offer some assistance with this pls,
:
: Is it possible to have the result of this formula
: =SUM(DynamicRange)/COUNTIF(DynamicRange,">0")displayed as a comment
attached
: to cell B1? The comment would need to continually update as dynamic data
is
: changing.
:
: TIA
:
Here is some input

to add a comment to a cell use
Range("E1").AddComment.Text "Your Comment Here"
Note this assumes there is no comment already existing, if there is you will
get an error. Either check for an existing comment first or use On Error
Resume Next

To know when to add this comment, you would need to look for a change event
Private Sub Worksheet_Change(ByVal Target As Range)
'your add a comment to a cell code here
End Sub
You would need to check if the target range is in your dynamic range.

Post back if you get stuck
Paul D
 
In this example it is the Name of a Dynamic Range I have set up for accepting
new data.
 
Right click on the Sheet tab of the worksheet that has the DynamicRange
defined. Select View Code. Paste in this code in the resulting module

Private Sub Worksheet_Calculate()
Me.Range("B1").NoteText ( _
Application.Sum(Range("DynamicRange")) / _
Application.CountIf(Range("DynamicRange"), ">0"))
End Sub
 

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

Back
Top