Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I beg to differ on what was asked for. The OP indicated that he/she would
take the results of the array (X, Y) and "then load the results of the Function into a 2D Array" Sounded like the OP was asking for a 1D array to be returned. Which was why I later added the part about ReDimming dTmp to a 2D array, implying that the OP could do it all in the function and save time. "Jim Thomlinson" wrote: ... Your example is a 1d array which is not what was asked for. -- HTH... Jim Thomlinson "Charlie" wrote: To declare a function as an array function it must be typed as String, Long, Double, etc., not Variant Public Function XYCoords(X as String, Y as String) As Double() Dim dTmp as Double ReDim dTmp(2) 'Note - I always use Option Base 1 in all my modules dTmp(1) = CDbl(X) dTmp(2) = CDbl(Y) XYCoords = dTmp End Function End Function "ExcelMonkey" wrote: I want to create a function which returns an array. For Example I want ArrayFunction to return X,Y. I will then load the results of the Function into a 2D Array with 2 colums: Private FunctionArray(A as String, B as String) As Variant 'This needs to produce a result that looks like X,Y End Function How do I set up the function to return an array result (2 values)? Thanks EM |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array function that returns values within several intervals | Excel Worksheet Functions | |||
Create VBA function that returns many values | Excel Programming | |||
custom excel function returns array, showing #VALUE in cells | Excel Programming | |||
How to use function that returns array of variable size? | Excel Programming | |||
how do I create a UDF (VBA) that returns an array (ctrl+shift+enter) | Excel Programming |