Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text format - setting text colour with code | Excel Discussion (Misc queries) | |||
setting comment defaults | Excel Worksheet Functions | |||
setting standard comment size for all rows in a worksheet. | Excel Discussion (Misc queries) | |||
Setting size of comment under macro control? | Excel Programming | |||
comment setting defaults | Excel Discussion (Misc queries) |