#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default comments

Rod

You can use error checking to see if a comment exists. Unprotecting and
reprotecting is as good as any way to put the comments in. Here's an
example for checking if a comment exists, no protection stuff included.

Sub test()

Dim rng As Range
Dim OldComm As String

Set rng = Range("a1")

On Error Resume Next
OldComm = rng.Comment.Text

If Err = 0 Then
rng.Comment.Text OldComm & vbLf & "More comments here"
Else
rng.AddComment "First comment"
End If

On Error GoTo 0

End Sub

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Rod Taylor" wrote in message
.. .
I have a sub that will place a comment in the cell if the info is more

then
a certain number of charters.
However I have two problems with this.
first if I protect the sheet with userinterface only then it won't put in
the comment
I got around this by unprotect the sheet but wondering if there might be
another way.

My new problem is if the sub to place a comment is called and the cell
already has a comment there then the program hangs

If I new that there was already a comment there then I found out how to

turn
this into a variable and then place both in the cell as a comment.
so How do I find out if a cell currently has a comment or is there a

better
way to do this

Thanks in advance






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
excel 2000 how to format the comments font all comments Delquestion Excel Discussion (Misc queries) 1 October 8th 09 02:19 PM
Comments box Bryan De-Lara[_2_] Excel Worksheet Functions 6 September 17th 09 07:42 AM
in excel useing comments how do you add clip art to comments? dhouse New Users to Excel 2 July 18th 07 08:14 AM
Comments Mel Excel Discussion (Misc queries) 2 May 31st 06 01:06 PM


All times are GMT +1. The time now is 03:07 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"