Macro to add up values in COMMENTs

  • Thread starter Thread starter pcor
  • Start date Start date
P

pcor

Hi
I did receive an very nice macro to carryout a search of ALL comments
on a worksheet. What I really wanted was to have a macro that would
provide a total for an active cell.
IE
If I put my cursor on a12, and A12 contains a comment such as:
apples=12
oranges=23
The macro would place the value of 35(12+23) in that cell.
Thanks in advance
 
Do the texts in the comments follow explicit rules, i.e., is it that
you will always want to add all the numbers from the comment that
follow '=' in the comment? Or will you always want to add all the
numbers that are in the comment text at the end of each row within the
comment?

You might be up for a struggle as it's not that likely that you'd have
such an explicit/enforced rules around the text in the comment.
 
Do the texts in the comments follow explicit rules, i.e., is it that
you will always want to add all the numbers from the comment that
follow '=' in the comment? Or will you always want to add all the
numbers that are in the comment text at the end of each row within the
comment?

You might be up for a struggle as it's not that likely that you'd have
such an explicit/enforced rules around the text in the comment.



- Show quoted text -

Yes the number in the commenst will always be preceeded by a = sign

such as
apples=23
oranges=12
pears=3
Thanks
 
Back
Top