ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   No Returns on Fuction Call (https://www.excelbanter.com/excel-programming/327508-no-returns-fuction-call.html)

PJohnson

No Returns on Fuction Call
 
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



PJohnson

No Returns on Fuction Call
 
Never mind. I realize what the problem is. I should be asking for returns
with "PetesMAcro=..." under the case select statements.


"PJohnson" wrote in message
news:LZQ7e.2094$H53.1655@lakeread05...
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






All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com