Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Terry, it sounds like you want to add text to a comment that is alread there. Taking what Shah wrote and modifying it to update rather tha overwrite, it would look like this. Sub Test() Dim rng As Range Dim cmttext As String, oldtext as string cmttext = "Insert New comment text here." Set rng = ActiveCell If Not rng.Comment Is Nothing Then If MsgBox("Below Comment is already present in the active cell.Do You want to update it." _ & vbNewLine & rng.Comment.Text, vbYesNo, "Update Comment") = vbYes Then oldtext = rng.comment.text rng.Comment.Delete rng.AddComment oldtext & chr(13) & cmttext End If Else rng.AddComment cmttext End If End Sub Otherwise if you just want to overwrite it, Shah's procedure i perfect. Jaso -- jt ----------------------------------------------------------------------- jtp's Profile: http://www.excelforum.com/member.php...fo&userid=2113 View this thread: http://www.excelforum.com/showthread.php?threadid=49599 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel and searching for a string in a cell where comments have been added | Excel Discussion (Misc queries) | |||
Allow comments to be added to protected worksheet? - Excel 2007 | New Users to Excel | |||
Delete added comments | Excel Discussion (Misc queries) | |||
How to judge wheter an object is existing or not | Excel Programming | |||
Searching within comments added to cells | Excel Programming |