Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA - checking for existance of a property
Hi All,
I'm making a function that works with the Range.Comment object. There's Comment.Text, but if there's nothing in it, it just errors out. How to check if .Text exists or not before attempting to read from it? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA - checking for existance of a property
B,
Use the error to your advantage: Sub Test() Dim myT As String On Error Resume Next myT = "No Comment!" myT = ActiveCell.Comment.Text MsgBox IIf(myT = "", "Comment is blank", myT) End Sub "B" wrote in message ... Hi All, I'm making a function that works with the Range.Comment object. There's Comment.Text, but if there's nothing in it, it just errors out. How to check if .Text exists or not before attempting to read from it? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA - checking for existance of a property
On May 25, 1:40 am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote: B, Use the error to your advantage: Sub Test() Dim myT As String On Error Resume Next myT = "No Comment!" myT = ActiveCell.Comment.Text MsgBox IIf(myT = "", "Comment is blank", myT) End Sub "B" wrote in message ... Hi All, I'm making a function that works with the Range.Comment object. There's Comment.Text, but if there's nothing in it, it just errors out. How to check if .Text exists or not before attempting to read from it? Thanks Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Checking if a property contains another specific string | Excel Programming | |||
Checking HasPassword property without opening | Excel Programming | |||
Test for for sheets existance | Excel Programming | |||
How to check for the existance of a Sheet (or not) | Excel Programming | |||
Existance Check Fails | Excel Programming |