ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Append to Comment (https://www.excelbanter.com/excel-programming/287680-append-comment.html)

LSB

Append to Comment
 
Hi Experts,

I would like to write a macro that can check whether the
activecell contains any comment, and if there is I would
like to append new string to the existing comment. If
there is none, then I would like to add a new comment to
the cell.

Can you experts out there help me with this?

MANY THANKS IN ADVANCE.

LSB

Paul B[_6_]

Append to Comment
 
Here is one way, don't remember who to give credit to for the macro

Sub CommentAddOrEdit()
'adds new plain text comment or positions
'cursor at end of existing comment text
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
End If
SendKeys "%ie~"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"LSB" wrote in message
...
Hi Experts,

I would like to write a macro that can check whether the
activecell contains any comment, and if there is I would
like to append new string to the existing comment. If
there is none, then I would like to add a new comment to
the cell.

Can you experts out there help me with this?

MANY THANKS IN ADVANCE.

LSB




Dave Peterson[_3_]

Append to Comment
 
It looks like it came from he

http://www.contextures.com/xlcomments03.html#Plain
(Debra Dalgleish's site)

She has lots of other sample code, too.

Paul B wrote:

Here is one way, don't remember who to give credit to for the macro

Sub CommentAddOrEdit()
'adds new plain text comment or positions
'cursor at end of existing comment text
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
End If
SendKeys "%ie~"
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"LSB" wrote in message
...
Hi Experts,

I would like to write a macro that can check whether the
activecell contains any comment, and if there is I would
like to append new string to the existing comment. If
there is none, then I would like to add a new comment to
the cell.

Can you experts out there help me with this?

MANY THANKS IN ADVANCE.

LSB


--

Dave Peterson


Paul B[_6_]

Append to Comment
 
Thanks Dave, I will make a note of that

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Dave Peterson" wrote in message
...
It looks like it came from he

http://www.contextures.com/xlcomments03.html#Plain
(Debra Dalgleish's site)

She has lots of other sample code, too.

Paul B wrote:

Here is one way, don't remember who to give credit to for the macro

Sub CommentAddOrEdit()
'adds new plain text comment or positions
'cursor at end of existing comment text
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
End If
SendKeys "%ie~"
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"LSB" wrote in message
...
Hi Experts,

I would like to write a macro that can check whether the
activecell contains any comment, and if there is I would
like to append new string to the existing comment. If
there is none, then I would like to add a new comment to
the cell.

Can you experts out there help me with this?

MANY THANKS IN ADVANCE.

LSB


--

Dave Peterson





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

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