Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default setting comment text from VB code

I am needing to have VB code place text into the comment box of a series of
cells. Currently the text to be placed is being retrieved from other areas
and being held in a array. At the conclusion of another routine it needs to
be placed on a comparison page for comparing a group of choices. I have
tried using "Activecell.Comment = Comments(X)" where Comments(X) is the
array with the info. However this results in a error "Object does not
support this property or method". Honestly I am at a loss on how to
acomplish what I am wanting.

I have looked in the help documentation but was not able to locate what I
need. I appreciate all help given.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default setting comment text from VB code

Activecell.Comment = Comments(X) <<

Incorrect syntax.

If the cell doesn't already have a comment, you need to add it first:

ActiveCell.AddComment

Then, to set the text of the comment:

ActiveCell.Comment.Text Text:=Comments(X)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default setting comment text from VB code

To find the Help just type comment, cursor into the middle of the word and
press F1.

To add a comment:

With Worksheets(1).Range("e5").AddComment
.Visible = False
.Text "reviewed on " & Date
End With

To modify a comment:

Worksheets(1).Range("E5").Comment.Text "reviewed again on " & Date

Fot the Active Cell:

With ActiveCell.AddComment
.Visible = False
.Text "reviewed on " & Date
End With

Regards

Trevor


"Brad Sumner" wrote in message
...
I am needing to have VB code place text into the comment box of a series of
cells. Currently the text to be placed is being retrieved from other
areas
and being held in a array. At the conclusion of another routine it needs
to
be placed on a comparison page for comparing a group of choices. I have
tried using "Activecell.Comment = Comments(X)" where Comments(X) is the
array with the info. However this results in a error "Object does not
support this property or method". Honestly I am at a loss on how to
acomplish what I am wanting.

I have looked in the help documentation but was not able to locate what I
need. I appreciate all help given.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default setting comment text from VB code

Range("E6").Select
Range("E6").AddComment
Range("E6").comment.Visible = False
Range("E6").comment.Text Text:="Happy Day"

is a syntax that works. In your case "Happy Day" would be replaced by an
element of your string array.
--
Gary's Student


"Brad Sumner" wrote:

I am needing to have VB code place text into the comment box of a series of
cells. Currently the text to be placed is being retrieved from other areas
and being held in a array. At the conclusion of another routine it needs to
be placed on a comparison page for comparing a group of choices. I have
tried using "Activecell.Comment = Comments(X)" where Comments(X) is the
array with the info. However this results in a error "Object does not
support this property or method". Honestly I am at a loss on how to
acomplish what I am wanting.

I have looked in the help documentation but was not able to locate what I
need. I appreciate all help given.

Reply
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
Text format - setting text colour with code NDBC Excel Discussion (Misc queries) 6 July 1st 09 10:15 PM
setting comment defaults gingertom Excel Worksheet Functions 1 June 3rd 08 01:19 PM
setting standard comment size for all rows in a worksheet. RALIB Excel Discussion (Misc queries) 1 June 26th 06 11:05 PM
Setting size of comment under macro control? Don Wiss Excel Programming 2 November 19th 05 03:49 AM
comment setting defaults EastSider Excel Discussion (Misc queries) 1 June 21st 05 12:55 AM


All times are GMT +1. The time now is 10:57 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"