The opposite of True is Not True, so...
If Not Cells(x, y).Comment Is Nothing Then
z = True
Else
' No comment
End If
Out of curiosity, what are you doing? I ask because it almost sounds like
the purpose of your code is to find and then do something with the comments
in a column and not do anything else. If that is the case, you can iterate
the Comments collection and work directly with the ones you want. For
example, this macro...
Sub FindComments()
Dim C As Comment
If ActiveSheet.Comments.Count > 0 Then
For Each C In ActiveSheet.Comments
If C.Parent.Column = 1 Then
Debug.Print C.Parent.Address(0, 0) & " has the comment: " & C.Text
End If
Next
End If
End Sub
will print out the address of the cells in Column A and what the comment is
that it contains. Obviously, this is a very simplistic; however, you can do
whatever you need to in place of the Debug.Print statement I used in my
example. Inside the inner If-Then block, C will hold a reference to a
Comment object which you can use in your code. I'm not sure what you are
trying to do (assuming I'm right and that you only are interested in doing
something only with the comments or the cells that contain the comments),
but if you give us more details, we would be happy to help.