Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to a UDF that uses arrays and worksheet matrix functions to
calculate the intersection of three spheres. I have declared several 1- and 2-D double arrays to store data. I originally declared these array variables as doubles, but I found I could not use functions like the following example: Dim tempMatrix(1 to 3, 1 to 3) as Double tempVector = identity(tempVector) where "identity" is a UDF that accepts a square array and sets it to an identity matrix. I imagine that I cannot assign the function's return to tempVector because it is a double array, not a Variant (i.e. not an object). I declared these variables as Doubles because I have read that variants are slow and inefficient and should be avoided if possible. How then would be the best way to fill these variable? Should I use subroutines and send the double array as a parameter? Or should I use variant arrays? But then, variant arrays cannot be initialized with dimensions, right? I.e: Dim tempVector(1 to 3, 1 to 3) as Variant I'm looking for the Best Practice here. Thanks. Pflugs |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Functions for manipulating arrays | Excel Discussion (Misc queries) | |||
Functions/arrays | Excel Discussion (Misc queries) | |||
Arrays parameters in Functions | Excel Worksheet Functions | |||
Advice for VBA functions using arrays | Excel Programming | |||
Arrays as Arguments in Functions | Excel Programming |