View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Code to see if Comment Exists

for the second, possibly ActiveCell.Activate

Dim cmt as Comment
On Error Resume Next
set cmt = ActiveSheet.Range("B9").Comment
On Error goto 0
if not cmt is nothing then
' append text
Else
' add a comment
End if

--
Regards,
Tom Ogilvy


"wardides" wrote in
message ...

Hi,


I have 2 queries which are currently wrecking my head.

Do you know what the code is to see if a comment exists. If it exists I
will amend the text and if it dosen't exist then I will enter a comment
but I dont know how to see if there is alreay one active on the cell.
I thought it would be something like
If Cells(row_index, 2).Comment = True Then

but that is not it. Any ideas.

Also, when I run a macro that has popped upa number of forms , when
they finish they dont seemto give the contrlol back to the excel
screen. Excel is still on the screen but the blue bar at the top is
slightly out of focus and you have to click on it to bring it back to
vlue. Then you can edit the cells again.

Is there a command to send the screen back so excel will be active ?

Regards
Brian


--
wardides
------------------------------------------------------------------------
wardides's Profile:

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