Logo 
Search:

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: 1931
  

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.

Share: 

 

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")
Else
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 :)

 




Tagged: