mgp
Mechanical
- May 30, 2001
- 224
Can anyone tell me if there is a way to avoid getting an error message when using a user defined function to refer to a named range?
Say I have three named ranges:
A1:A5 named "Name1"
B1:B5 named "Name2"
C1:C5 named "Name3"
-all cells filled with numbers
Then I have a VBA worksheet function
Function testname(a, b, c)
testname = a + b + c
End Function
When typing into Cell D1:
=testname(Name1;Name2;Name3)
I get the #Value error message
This works for all the built-in functions. Is there a way to make the userdefined function understand it also?
regards
Mogens
Say I have three named ranges:
A1:A5 named "Name1"
B1:B5 named "Name2"
C1:C5 named "Name3"
-all cells filled with numbers
Then I have a VBA worksheet function
Function testname(a, b, c)
testname = a + b + c
End Function
When typing into Cell D1:
=testname(Name1;Name2;Name3)
I get the #Value error message
This works for all the built-in functions. Is there a way to make the userdefined function understand it also?
regards
Mogens