LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Test for NULL string?

My bad....

I was just looking for instances in which "no string" or a NULL
value is passed to the function. I'm thinking that the
"If myData = vbNullString" will be sufficient enough.

BTW, I'm a long time C++ programmer, so I developed a
habit of doing a lot of NULL error testing. VBA seems to
be more "type safe" when it comes to null strings, so I
kinda get the impression that I don't need to always check
for NULL strings, but I still wanted to know how to do it
anyways.

Thanks for the info.


"Mike H" wrote in message
...
Robert,

I missed the 'invalid' bit but you don't tell us what 'invalid' means.
Maybe
you mean a number?

Function Foo(ByVal myData As String)
If myData = vbNullString Or IsNumeric(myData) Then
Foo = "No string passed to function"
Exit Function
End If
' Do stuff
End Function
--


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to test for imported Access table null cell? G Lykos Excel Worksheet Functions 3 October 6th 08 02:54 PM
Test for null - insert a row if isnull Bonnie Excel Discussion (Misc queries) 3 July 10th 07 09:20 PM
String concatenation having null character marco Excel Programming 4 March 13th 07 07:43 PM
Function returning null value instead of string value shivboy[_14_] Excel Programming 3 July 7th 06 01:41 PM
Replace null string with blank cell gjcase Excel Discussion (Misc queries) 2 August 9th 05 02:13 PM


All times are GMT +1. The time now is 07:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"