I am trying to create a user defined function to calcutate the difference between a range of cells as in Max(a1:a21)-Min(a1:a21) I Thought I'd try to create a simple UDF for Area just to see how it works.
Function(Length as Double, Width as Double)
Area = Length * Width
End Function
Now this works, but only in the current workbook. If I try it in any other workbook, I get #NAME error. So, two questions. How would I code the Difference function and how can I get any workbook to see it?
Any help appreciated.
David
Function(Length as Double, Width as Double)
Area = Length * Width
End Function
Now this works, but only in the current workbook. If I try it in any other workbook, I get #NAME error. So, two questions. How would I code the Difference function and how can I get any workbook to see it?
Any help appreciated.
David