I am getting a Value# error instead.

HELP!!! and thanks

Public Function CurveEXPPDF(A, DefineCurve As Range)

' The Probability Density Function of a Exponential

'Put in the values for the specific curve

Shift = DefineCurve(1)

Maximum = DefineCurve(3)

Theta = DefineCurve(4)

'Determine if the curve is outside the allowed parameters (Less than the shift or greater than the Maximum)

If A < Shift Then CurveEXPPDF = 0: End

**<-- If a number lower than the 'shift' is selected I want to return a value of zero**

If A > Maximum Then CurveEXPPDF = 0: End

' Get how far into the actual curve the X value is (adjusting for the shift)

X = A - DefineCurve(1)

CurveEXPPDF = Exp(-X / Theta) / Theta

End Function