Hi. Vba has its own Sqrt function, so SQRT wasn't included under
"Application.WorksheetFunction."
FieldsXY = Sqr((endx - startx) ^ 2 + (endy - starty) ^ 2)
HTH :)
--
Dana DeLouis
Win XP & Office 2003
"alex.k" wrote in
message ...
Hi,
I am trying to construct a simple function to calculate distance
between 2 points on Carthesian plane. The function I wrote:
Function FieldsXY(startx, starty, endx, endy)
FieldsXY = Application.SQRT((endx - startx) ^ 2 + (endy - starty)
^ 2)
End Function
The only result I'm getting is #VALUE! error. I tried to declare all
arguments as integer, didn't help. Help would be greatly appreciated,
as I'm no expert in this :).
regards,
Alex
--
alex.k
------------------------------------------------------------------------
alex.k's Profile:
http://www.excelforum.com/member.php...o&userid=24637
View this thread: http://www.excelforum.com/showthread...hreadid=470598