Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a UDF that goes off and retrieves various pieces of data from a
database based on parameters that the user enters into the UDF. Some of the data in the DB are strings, and others are Integers or Doubles. My UDF returns a string so that any of those values can be displayed (i.e. ints and doubles from the DB are converted to string in my method that calls the DB). Public Function MyUDF(param1, param2) As String If a value coming back from the database is the number 3.51, the UDF returns it to the calling cell as "3.51". If I try to format this in Excel and ask it to display one decimal point, for example, it does nothing because it treats 3.51 as a string. If I wrap the call to the UDF with =VALUE, that works, but I wanted to avoid having the user have to do this. I also wanted to avoid having seperate UDFs for each return type (i.e. one that returns String, one that returns Integer, etc.) Does anyone have any suggestions? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I Assign A User Defined Function To A Cell? | Excel Worksheet Functions | |||
Which cell is calling a user-defined function? | Excel Programming | |||
User Defined Function - Using Cell Range | Excel Programming | |||
current cell in user-defined function | Excel Programming | |||
User defined function & formatting | Excel Programming |