In my excel sheet my entire column(A) i named it "myRadius" and in "A1" the cell value is 15.25. My entire column(B) i named it "myConstant" and the cell value for "B1" is 5. Then in "C1" i type some formulas which is "=myRadius*myConstant" and the result is 76.25. But when i create a VBA Function(UDF) for cleaner code and type it in "D1" the result is "#VALUE!". Here is my UDF.
Function ComplexCircle(myRad As Variant, myCons As Variant)
ComplexCircle = myRad * myCons
End Function
In "D1" i type "=ComplexCircle(myRadius,myConstant)" Do i missing something? I did try variant/double/range parameter but it doesn't work
=ComplexCircle(A1,B1)
? Or what's wrong with good old-fashioned=A1*B1
- why do you use the named ranges?=ComplexCircle(myRadius,myConstant)
that implies that you have named ranges calledmyRadius
andmyConstant
. If this is a question about basic usage of Excel then this may not be the right place for it. See the help center for more information about what's on-topic on this site.