ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding Cell Commnets together (https://www.excelbanter.com/excel-programming/321614-adding-cell-commnets-together.html)

Jeff

Adding Cell Commnets together
 
I am trying to string together the comments in several columns into a "Meta"
comment in the "Total" column. The idea is to bring together all of the rows
comments together as one large comment.

I have tried ths and severla other ways to accomplish my task, but cannot
get it to work.
For q = C To 3 Step -3
Dim cmt As Comment
Set cmt = Cells(i, q).Comment
Line_cmt = Cells(i, (C + 1))
If Not cmt Is Nothing Then
Line_cmt = Line_cmt & AddComment.Text
End If
Next q

Tom Ogilvy

Adding Cell Commnets together
 


for i = 1 to 10
Line_cmt = ""
For q = C To 3 Step -3
Line_cmt =lint_cmt & cells(i,q).NoteText
Next q
msgbox Line_cmt
cells(i,C+3).NoteText Line_cmt
Next i

If your final comment string exceeds 255 characters in length, then you will
need to use a loop at the end.

--
Regards,
Tom Ogilvy


"Jeff" wrote in message
...
I am trying to string together the comments in several columns into a

"Meta"
comment in the "Total" column. The idea is to bring together all of the

rows
comments together as one large comment.

I have tried ths and severla other ways to accomplish my task, but cannot
get it to work.
For q = C To 3 Step -3
Dim cmt As Comment
Set cmt = Cells(i, q).Comment
Line_cmt = Cells(i, (C + 1))
If Not cmt Is Nothing Then
Line_cmt = Line_cmt & AddComment.Text
End If
Next q




Jeff

Adding Cell Commnets together
 
Tom Thanks a ton for the code fix, I thought I was going to kill myself. The
biggest problem was getting the variables Dim'd correctly, once I looked inot
the Help file I was on my way.

"Tom Ogilvy" wrote:



for i = 1 to 10
Line_cmt = ""
For q = C To 3 Step -3
Line_cmt =lint_cmt & cells(i,q).NoteText
Next q
msgbox Line_cmt
cells(i,C+3).NoteText Line_cmt
Next i

If your final comment string exceeds 255 characters in length, then you will
need to use a loop at the end.

--
Regards,
Tom Ogilvy


"Jeff" wrote in message
...
I am trying to string together the comments in several columns into a

"Meta"
comment in the "Total" column. The idea is to bring together all of the

rows
comments together as one large comment.

I have tried ths and severla other ways to accomplish my task, but cannot
get it to work.
For q = C To 3 Step -3
Dim cmt As Comment
Set cmt = Cells(i, q).Comment
Line_cmt = Cells(i, (C + 1))
If Not cmt Is Nothing Then
Line_cmt = Line_cmt & AddComment.Text
End If
Next q






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

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