No Returns on Fuction Call

  • Thread starter Thread starter PJohnson
  • Start date Start date
P

PJohnson

I would appreciate any help here. Why am I not getting any returns? The
function calls without error, but I get no returns. I do this type of things
with numbers all the time, but never with text. Where am I going wrong?

If active cell is A1 with the fuction call (e.g.,
"=personal.xls!PetesMacro(B1)") and B1 has somthing like "Agriculture":
Thanks in advance.
Pete

=========

Function PetesMacro(MyText) As String

MyText = Trim(MyText)
MyText = Left(MyText, 1)
MyText = UCase(MyText)

Select Case MyText
Case "A"
MyText = "has successfully completed an"
Case "E"
MyText = "has successfully completed an"
Case "I"
MyText = "has successfully completed an"
Case "O"
MyText = "has successfully completed an"
Case "U"
MyText = "has successfully completed an"
Case Else
MyText = "has successfully completed a"
End Select

End Function
 
Never mind. I realize what the problem is. I should be asking for returns
with "PetesMAcro=..." under the case select statements.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top