Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA built in functions I.E. VBA.Isempty, VBA.IsDate

Status
Not open for further replies.

Jamesm601

Programmer
Joined
Feb 6, 2004
Messages
27
Location
US
Hi All.
I'm looking for a way to test, in an if statement, whether or not a cell contains text. I've done the same thing with dates, and empty cells using VBA.Isdate and VBA.Isempty, but I don't see a VBA.IsText or VBA.IsString function. Is there one, or is there another way?

Thanks in advance.

James M.
 
Hi,

If it's a value (ie not an object, NULL, Empty, boolean etc) then

(Not IsNumeric) is text.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
As long as that rules out dates, it should work perfectly. I'l give it a try.

Thanks Skip.

James M.

 
If Not Isnumeric AND not IsDate

should sort it - although dates are numeric really

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top