building comments from text cells
On Jan 31, 12:45 am, Gord Dibben <gorddibbATshawDOTca wrote:
Assuming cells in row 9 of Sheet B are linked to Sheet A
This macro will place whatever is in Sheet B A9:M9 into Comments in A8:M8
Is that what you want?
Sub Comment_Add()
Dim cmt As Comment
Dim r As Range
For Each r In Sheets("Sheet2").Range("A8:M8") 'adjust to suit
Set cmt = r.Comment
If cmt Is Nothing Then
Set cmt = r.AddComment
cmt.Text Text:=r.Offset(1, 0).Text
End If
Next r
End Sub
Comments will not update if values are changed.
Do you need something dynamic?
Gord Dibben MS Excel MVP
On Fri, 30 Jan 2009 10:48:53 -0800 (PST), "Michael.Tarnowski"
wrote:
Hi community,
I have an Excel application where I append a new line (by a VBA macro
assign to a button) from a kind of template.
Sheet A is the application, sheet B contains the "row template":
Sheet B:
cells in row 08: each cells is a comment text
09: each cell is a header description
10: each cell contains a formula
Row 09 in sheet A is the table's heading defined in sheet B, 09. The
application uses row 03 of Sheet B to append a new line in sheet A.
What I want to achieve is that all comments (sheet B, row 8) are Excel
real comments of the cells of sheet A, row 9.
Any ideas?
Gord you got it - thats exactly what I'am looking for. Dynamic updates
would be great!
Thanks Michael
|