ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Linking a comment to a range (https://www.excelbanter.com/excel-programming/335420-linking-comment-range.html)

Kevin Smith[_2_]

Linking a comment to a range
 
Hi,

I want to try and do a smart thing with cell comments.

The user is asked to create a custom group from a predefined list (for
example say they are a list of names).
The user types in the name of their group (e.g. "Boys") then, using tick
boxes, selects all the boys they want in that group.

What I would like to see is the name of the group appearing on the next
sheet and the cell comment to list those names that were selected.

I can manage the selected data okay, just cannot get that into a comment.

Any help would be great

Cheers

Kevin



Bob[_62_]

Linking a comment to a range
 
Use the addcoment method of the range object, i.e.

Worksheets(1).Range("E5").AddComment "Current Sales"


Bob L.


"Kevin Smith" wrote in message
...
Hi,

I want to try and do a smart thing with cell comments.

The user is asked to create a custom group from a predefined list (for
example say they are a list of names).
The user types in the name of their group (e.g. "Boys") then, using tick
boxes, selects all the boys they want in that group.

What I would like to see is the name of the group appearing on the next
sheet and the cell comment to list those names that were selected.

I can manage the selected data okay, just cannot get that into a comment.

Any help would be great

Cheers

Kevin





Kevin Smith[_2_]

Linking a comment to a range
 
Thanks Bob.

This will add a comment in E5 with the text "Current Sales" in the comment.

I already have the comment in E5 and I would like it to reflect what is in
cell A1 or A1:A5 etc.

Thanks

"Bob" wrote:

Use the addcoment method of the range object, i.e.

Worksheets(1).Range("E5").AddComment "Current Sales"


Bob L.


"Kevin Smith" wrote in message
...
Hi,

I want to try and do a smart thing with cell comments.

The user is asked to create a custom group from a predefined list (for
example say they are a list of names).
The user types in the name of their group (e.g. "Boys") then, using tick
boxes, selects all the boys they want in that group.

What I would like to see is the name of the group appearing on the next
sheet and the cell comment to list those names that were selected.

I can manage the selected data okay, just cannot get that into a comment.

Any help would be great

Cheers

Kevin






Tom Ogilvy

Linking a comment to a range
 
Assume your group data is on sheet1 with the groups listed in column A and
the list of members in column B such as

group1 member1
member2
member3
group2 member4
member5
member6
member7
group3 member8

Looking for the group listed in E5


With Worksheets("Sheet1")
for each cell in .Range("A1:A500")
if cell.Value = Worksheets("Sheet2").Range("E5").Value then
i = cell.row + 1
do
sStr = .Cells(i-1,2).Value & ", "
i = i + 1
loop while isempty(.cells(i,1) or i = 501
exit for
end if
Next
End With
sStr = application.Trim(sStr)
sStr = Left(sStr,len(sStr) - 1)
worksheets("Sheet2").Range("E5").NoteText Text:=sStr

--
Regards,
Tom Ogilvy

"Kevin Smith" wrote in message
...
Thanks Bob.

This will add a comment in E5 with the text "Current Sales" in the

comment.

I already have the comment in E5 and I would like it to reflect what is in
cell A1 or A1:A5 etc.

Thanks

"Bob" wrote:

Use the addcoment method of the range object, i.e.

Worksheets(1).Range("E5").AddComment "Current Sales"


Bob L.


"Kevin Smith" wrote in message
...
Hi,

I want to try and do a smart thing with cell comments.

The user is asked to create a custom group from a predefined list (for
example say they are a list of names).
The user types in the name of their group (e.g. "Boys") then, using

tick
boxes, selects all the boys they want in that group.

What I would like to see is the name of the group appearing on the

next
sheet and the cell comment to list those names that were selected.

I can manage the selected data okay, just cannot get that into a

comment.

Any help would be great

Cheers

Kevin









All times are GMT +1. The time now is 02:10 AM.

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