referencing range elements inside the macro
Hi,
I am creating a UD function of the following form Function interpolate(z,
inputX as Range , inputY as Range)
In the body of the function, I need to cross-reference elements of inputX
with inputY ranges.
If it were a spreadsheet, I could use lookups, offset, match, index
functions. I am not really sure how to do this in VBA inside the function.
Can someone please illustrate this with a few examples of sample code?
For example, I need to find an element in inputY with a position
corresponding to inputX and perform some math on it. So, if 17 is in the
third position in inputX , I want to get a corresponding inputY element.
Hope it is not overly confusing.
Thank you for your help.
--
______
Regards,
Greg
|