View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
fergusor[_2_] fergusor[_2_] is offline
external usenet poster
 
Posts: 1
Default Returning a string from a function

Can anyone help. I'm trying to get a year returned from a function bu
it keeps coming back empty.

I'm calling it, sending a string... in this case '2004'

Call messageYearResponse(yearResponse)

Then the function is supposed to return xYear as 2004... instead it'
coming back empty.

Private Function messageYearResponse(ByVal yearResponse As String)
Dim xYear

If yearResponse = "" Then
Exit Function
Else
If IsNumeric(yearResponse) Then
xYear = CInt(yearResponse)
Else
msgbox ("Must be numeric"), vbOKOnly
Resume
End If
End If

End Functio

--
Message posted from http://www.ExcelForum.com