Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
LSB LSB is offline
external usenet poster
 
Posts: 8
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you append one row to another? BobVanS Excel Worksheet Functions 3 August 30th 07 02:04 PM
Append worksheets together in one bioyyy Excel Discussion (Misc queries) 1 October 14th 05 07:10 AM
How can I edit a comment w/o first having to select Show Comment Mary Ann Excel Discussion (Misc queries) 1 August 26th 05 12:34 AM
Hotkey problem w/ macro to append comment roadkill Excel Discussion (Misc queries) 1 April 6th 05 06:52 PM
a comment plugin & copy paste directly from excel to comment ? fr. RFM Excel Worksheet Functions 0 December 1st 04 11:29 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"