N
Neal Carron
The following function doesn't work (I get #VALUE in the cell)
It is called with, say, =IntrptFn2($B$56,$K11,$L11)
I've been unable to debug it.
Why doesn't it evaluate properly?
-------
Function IntrptFn2(sRel, tauLeft, tauRight) As Double
' =IntrptFn2($B$56,$K11,$L11) doesn't work
eL = Application.WorksheetFunction.Exp(-tauLeft)
eR = Application.WorksheetFunction.Exp(-tauRight)
es = Application.WorksheetFunction.Exp(-sRel)
IntrptFn2 = Abs((1 + tauLeft) * eL - (1 + tauRight) * eR)
' That's good for xLeft>0, or xRight<0). Now inbetween
If (tauLeft < 0 And tauRight > 0) Then
tauGreater = tauLeft
If (tauRight > tauLeft) Then
tauGreater = tauRight
End If
eG = Application.WorksheetFunction.Exp(-tauGreater)
IntrptFn2 = (1 + sRel) * es - (1 + tauGreater) * eG
End If
End Function
It is called with, say, =IntrptFn2($B$56,$K11,$L11)
I've been unable to debug it.
Why doesn't it evaluate properly?
-------
Function IntrptFn2(sRel, tauLeft, tauRight) As Double
' =IntrptFn2($B$56,$K11,$L11) doesn't work
eL = Application.WorksheetFunction.Exp(-tauLeft)
eR = Application.WorksheetFunction.Exp(-tauRight)
es = Application.WorksheetFunction.Exp(-sRel)
IntrptFn2 = Abs((1 + tauLeft) * eL - (1 + tauRight) * eR)
' That's good for xLeft>0, or xRight<0). Now inbetween
If (tauLeft < 0 And tauRight > 0) Then
tauGreater = tauLeft
If (tauRight > tauLeft) Then
tauGreater = tauRight
End If
eG = Application.WorksheetFunction.Exp(-tauGreater)
IntrptFn2 = (1 + sRel) * es - (1 + tauGreater) * eG
End If
End Function