I have an error when handling ranges. I have a function that returns a calculated value, like this
public function varcalc(a as range, b as range) as double
'description:
'read range a
'perform calculations
'write partial results to range b
'calculate variance and return as varcalc
end function
The function works very well when called from a macro. However, I also need to use it in a cell by calling
=varcalc(selected range a, selected range b)
The functions reads the range a properly but comes with the #VALUE error upon writing to range b.
I cannot figure out where is the problem, maybe with the scope or permissions? Any help would be appreciated. Thank you
public function varcalc(a as range, b as range) as double
'description:
'read range a
'perform calculations
'write partial results to range b
'calculate variance and return as varcalc
end function
The function works very well when called from a macro. However, I also need to use it in a cell by calling
=varcalc(selected range a, selected range b)
The functions reads the range a properly but comes with the #VALUE error upon writing to range b.
I cannot figure out where is the problem, maybe with the scope or permissions? Any help would be appreciated. Thank you