View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Test for NULL string?

Robert,

Maybe this

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

Mike
--
Mike

When competing hypotheses are equal, adopt the hypothesis that introduces
the fewest assumptions while still sufficiently answering the question.
Occam''''s razor (Abbrev)


"Robert Crandal" wrote:

I have the following function:

Function Foo (ByVal myData as String)
' Do stuff
End Foo

My question is, do I need to test if the "myData"
parameter is null or invalid?? How can I best
test the parater if it's valid or null or not??
(so i can avoid any errors)

thankx

.