LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Adding a variable value to a comment?

How can I add a variable value to a comment?
I want to create a comment that is based on a simple math function.

The comment tag would display the sum of the current cell plus that of one
other.

Here is what I have so far:
-----------------------
dim holdval, commentval
holdval = ActiveCell.Value
ActiveCell.ForumlaR1C1 = "=RC[0]+RC[-3]"
ActiveCell.AddComment
ActiveCell.Comment.Visible = True
commentval = ActiveCell.Value
ActiveCell.Comment.Text = commentval
ActiveCell.Value = holdval
ActiveCell.Select
---------------------------

Line 7 is where I'm getting all the problems. The error I get is "Assignment
to constant is not permitted". I've also tried this line:

ActiveCell.Comment.Text Text:= commentval

in which case I get an application error.

Am I just trying to do something that is impossible or is there another way
to get a variable value into a comment?

Thanks!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a picture to a comment box oxicottin Excel Discussion (Misc queries) 4 January 9th 07 10:55 PM
Adding a comment to a cell in VBA?! Maury Markowitz Excel Programming 8 October 27th 05 04:15 PM
Adding a new comment with a function? Cheese Excel Discussion (Misc queries) 4 July 31st 05 11:46 AM
Adding Comment to cell Troy H Excel Programming 5 May 14th 04 09:31 AM
Adding comment programmatically Carl Rapson Excel Programming 3 February 26th 04 11:01 PM


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"