View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NooK[_34_] NooK[_34_] is offline
external usenet poster
 
Posts: 1
Default Problems with LN in VBA

I am trying to create this function

Function CalcWeibX(N As Double, B As Double, Fx As Double) As Double
Dim Power As Double
Power = 1 / B
CalcWeibX = -N * ((Application.WorksheetFunction.Ln(1 - Fx))
(Power))

End Function

But all I keep getting is a "Invalid Procedure Call or Argument".

VBA won't allow me to have a Real number on both LN argument an
Power.

If I run LN(0.5)^2, it works

If I run LN(2)^(0.5), it works

But If I have real numbers on both arguments (Ex: LN(0.5)^0.2), I ge
the error. Am I doing something wrong here, I think it should work.

I've tried both Excel LN function and VBAs Log function and both giv
same error and I get something about not finding Excel Power functio
if I try to use

Application.WorksheetFunction.Power instead of the ^.

Best Regards

Noo

--
Message posted from http://www.ExcelForum.com