View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Code to add comment box

Chris,
Assuming this code is within a "With ActiveCell / End With" block, then it
will add a comment to the active cell, not to the cell in column "O".
Show the With block as well, as that will determine the location of the
comment.

NickHK

"chris46521" wrote
in message ...

I was wondering if anyone could tell me why the following code does not
automatically add a comment box to the active cell in column O when
"JOINT" is entered in. It was working before, but now the comment is
added to another cell.


Code:
--------------------
Dim Cmnt
If Me.Cells(.Row, "O").Value = "JOINT" Then
Set Cmnt = .Comment
If Cmnt Is Nothing Then
.AddComment
.Comment.Visible = True
.Comment.Text Text:="COG MEs:" & Chr(10)
.Comment.Shape.Select True
Else
.Comment.Visible = False
End If
End If
--------------------

Thanks!


--
chris46521
------------------------------------------------------------------------
chris46521's Profile:

http://www.excelforum.com/member.php...o&userid=35909
View this thread: http://www.excelforum.com/showthread...hreadid=565784