Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a user function that works fine when I supply a cell reference as an
argument. It also works if I supply a named call as the argument. However, when I supply the name of a range of cells, I get A #Value! error. Built-in functions (such as SQRT) work O-K. What do I need to do to user functions to make the arguments behave the same as for built-in functions. R.Ahlvin Example: | A | B | C -------------------------------- 1 |NAME | | 2 | 7 | 7 | 2.645751 3 | 4 | 4 | 2 4 | 8 | #Value | 4 NAME Refers to: =Sheet1!$A$2:$A$4 Formulas: | A B C -------------------------------------- 1 |NAME 2 | 7 =Fun(A2) =SQRT(A2) 3 | 4 =Fun(A3) =SQRT(A3) 4 | 8 =Fun(NAME) =SQRT(NAME) Function: Function FUN( ARG As Variant) DIM X As Double X = ARG.Value FUN = X End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Function Argument Question | Excel Discussion (Misc queries) | |||
Function (array argument, range argument, string argument) vba | Excel Programming | |||
Argument limit on user Function? | Excel Programming | |||
Array as Argument in User-Defined Functions | Excel Programming | |||
Passing an Array of User-Defined Type to an Argument of a Function | Excel Programming |