ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Linking Comment to Cell (https://www.excelbanter.com/excel-discussion-misc-queries/96302-linking-comment-cell.html)

Shaun

Linking Comment to Cell
 
I need to link information found in other sheets of my workbook to comment
boxes on my first sheet. Can this be done, and if so, how?? Any help is
much appreciated, thanks.

Shaun

Gary''s Student

Linking Comment to Cell
 
Try this UDF:

Function copycomment(r As Range)
Application.Volatile
Dim whereami As Range
Set whereami = Application.Caller
If whereami.Comment Is Nothing Then
Else
whereami.Comment.Delete
End If
whereami.AddComment Text:=r.Value
copycomment = ""
End Function
--
Gary''s Student


"Shaun" wrote:

I need to link information found in other sheets of my workbook to comment
boxes on my first sheet. Can this be done, and if so, how?? Any help is
much appreciated, thanks.

Shaun


Shaun

Linking Comment to Cell
 
Thank you very much, but I think this may be more technical than I am.
UDF?
What do I do with this code?

Shaun

"Gary''s Student" wrote:

Try this UDF:

Function copycomment(r As Range)
Application.Volatile
Dim whereami As Range
Set whereami = Application.Caller
If whereami.Comment Is Nothing Then
Else
whereami.Comment.Delete
End If
whereami.AddComment Text:=r.Value
copycomment = ""
End Function
--
Gary''s Student


"Shaun" wrote:

I need to link information found in other sheets of my workbook to comment
boxes on my first sheet. Can this be done, and if so, how?? Any help is
much appreciated, thanks.

Shaun


Gary''s Student

Linking Comment to Cell
 
Putting the code in is easy, just copy and paste from my post. See:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

By the way, with a small modification, the function can put the value in a
cell into any other cells's comment, not just the cell containing the
function.

This is an exception to the general rule about a function only returning a
value to a single cell.
--
Gary''s Student


"Shaun" wrote:

Thank you very much, but I think this may be more technical than I am.
UDF?
What do I do with this code?

Shaun

"Gary''s Student" wrote:

Try this UDF:

Function copycomment(r As Range)
Application.Volatile
Dim whereami As Range
Set whereami = Application.Caller
If whereami.Comment Is Nothing Then
Else
whereami.Comment.Delete
End If
whereami.AddComment Text:=r.Value
copycomment = ""
End Function
--
Gary''s Student


"Shaun" wrote:

I need to link information found in other sheets of my workbook to comment
boxes on my first sheet. Can this be done, and if so, how?? Any help is
much appreciated, thanks.

Shaun


Gord Dibben

Linking Comment to Cell
 
Shaun

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste GS's CopyComment code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Enter the formula in Sheet1 in the cell you want the comment in.

=CopyComment(Sheet2!A4)


Gord Dibben Excel MVP

On Tue, 27 Jun 2006 10:06:02 -0700, Shaun
wrote:

Thank you very much, but I think this may be more technical than I am.
UDF?
What do I do with this code?

Shaun

"Gary''s Student" wrote:

Try this UDF:

Function copycomment(r As Range)
Application.Volatile
Dim whereami As Range
Set whereami = Application.Caller
If whereami.Comment Is Nothing Then
Else
whereami.Comment.Delete
End If
whereami.AddComment Text:=r.Value
copycomment = ""
End Function
--
Gary''s Student


"Shaun" wrote:

I need to link information found in other sheets of my workbook to comment
boxes on my first sheet. Can this be done, and if so, how?? Any help is
much appreciated, thanks.

Shaun


Gord Dibben MS Excel MVP


All times are GMT +1. The time now is 12:55 PM.

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