Thread: HasComment ?!?
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John[_48_] John[_48_] is offline
external usenet poster
 
Posts: 3
Default HasComment ?!?

Bob,

Posted my suggestion below.

I like your suggestion too. I forgot about "Is Nothing", - good one.

regards,

John


"Bob Phillips" wrote in message
...
Tom,

Here's a small UDF to do it

Function HasComment(rng As Range)
If rng.Count 1 Then
HasComment = CVErr(xlErrValue)
Else
HasComment = Not (rng.Comment Is Nothing)
End If
End Function

=HasComment(A1) returns TRUE or FALSE as appropriate
=HasComment(A1:A2) returns #VALUE (more than 1 cell being referenced)

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Tom" wrote in message
...
Hi

I'd like to check, if the cell A1 contains a comment. If yes, the

comment
should be deleted. But the problem is, that the HasComment-property is

not
available. How to do?

Tom