MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

How can i let VBA know the ActiveCell has Comment Text or not

  Asked By: Cody    Date: Jan 16    Category: MS Office    Views: 1824

I want to run a code like

If ActiveCell.Comment.Text ="" then
End if

but it turn an error

How can i know that ActiveCell has Comment Text or not.



2 Answers Found

Answer #1    Answered By: Faiza Mian     Answered On: Jan 16

Then you post, please always indicate WHAT the error is. Also post your
actual code, not a hand-typed version of it.

However ...

Private Sub CommandButton1_Click()
If ActiveCell.Comment Is Nothing Then
MsgBox ("empty")
MsgBox (ActiveCell.Comment.Text)
End If
End Sub

Answer #2    Answered By: Felix Gray     Answered On: Jan 16

Ok. That's cool. Actually this code  new for me
I never know if there's a code like "Is" :)
It is getting more english than a code.
If VBA is so easy than that's good :)