ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding a value in the comment field (little red triangle)? (https://www.excelbanter.com/excel-programming/393947-adding-value-comment-field-little-red-triangle.html)

Barb

Adding a value in the comment field (little red triangle)?
 
Hi ,


I have cells that contain prices. I have a function to calculate
the sum of 5 cells. Is it possible to add this value in the comment field
(little red triangle in the corner of the fifth cell)?. Can I do it with VBA?

Thanks Jack


keeena

Adding a value in the comment field (little red triangle)?
 
I assume you're expecting the comment field to be dynamic/volatile?
Pretty sure that's not possible; value in a comment field is just
static text.

You could write a VBA routine that can add up cells and put the value
into a new or existing comment. This routine would need to be run
every time you changed or added new data (if you wanted the values to
be up-to-date). Could attach it to an Event so that it always runs
when the worksheet is selected.


On Jul 23, 12:40 pm, Barb wrote:
Hi ,

I have cells that contain prices. I have a function to calculate
the sum of 5 cells. Is it possible to add this value in the comment field
(little red triangle in the corner of the fifth cell)?. Can I do it with VBA?

Thanks Jack




Barb

Adding a value in the comment field (little red triangle)?
 
Hi Keeena,

Yes I just want to add the value that was calculated in VBA. That's
not Dynamic. how can I add the value of the variable that was calculated in
VBA in that comment field?

Thanks.

"keeena" wrote:

I assume you're expecting the comment field to be dynamic/volatile?
Pretty sure that's not possible; value in a comment field is just
static text.

You could write a VBA routine that can add up cells and put the value
into a new or existing comment. This routine would need to be run
every time you changed or added new data (if you wanted the values to
be up-to-date). Could attach it to an Event so that it always runs
when the worksheet is selected.


On Jul 23, 12:40 pm, Barb wrote:
Hi ,

I have cells that contain prices. I have a function to calculate
the sum of 5 cells. Is it possible to add this value in the comment field
(little red triangle in the corner of the fifth cell)?. Can I do it with VBA?

Thanks Jack





Keith R

Adding a value in the comment field (little red triangle)?
 
Barb/Jack-
it isn't clear to me if you are asking for more comprehensive help (how do I
add up the numbers in VBA in the first place) but with regards to just
adding it in a static comment, it is something like (air code):

Sheet1.Range("E4").Comment.Text Text:="The sum is " & cStr(MyTotal)

Where MyTotal is the variable where you've added up your values.

If you need to do this for multiple rows, you'll need to use a loop to cycle
through the appropriate rows (will it be the same rows each time, or do you
need to be able to specify which rows?), add them up (which cells need to be
added?) and decide if there are any conditions in which a total was
calculated in a previous run of the macro and needs to be removed.

If you need more help, just post again and let us know how far you got.

Keith


"Barb" wrote in message
...
Hi Keeena,

Yes I just want to add the value that was calculated in VBA.
That's
not Dynamic. how can I add the value of the variable that was calculated
in
VBA in that comment field?

Thanks.

"keeena" wrote:

I assume you're expecting the comment field to be dynamic/volatile?
Pretty sure that's not possible; value in a comment field is just
static text.

You could write a VBA routine that can add up cells and put the value
into a new or existing comment. This routine would need to be run
every time you changed or added new data (if you wanted the values to
be up-to-date). Could attach it to an Event so that it always runs
when the worksheet is selected.


On Jul 23, 12:40 pm, Barb wrote:
Hi ,

I have cells that contain prices. I have a function to
calculate
the sum of 5 cells. Is it possible to add this value in the comment
field
(little red triangle in the corner of the fifth cell)?. Can I do it
with VBA?

Thanks Jack








All times are GMT +1. The time now is 05:49 PM.

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