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: Zobah    Date: Nov 30    Category: MS Office    Views: 4890
  

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: Dirck Jansen     Answered On: Nov 30

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: Calais Bernard     Answered On: Nov 30

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: