neeraj89
Mechanical
- Oct 23, 2007
- 1
how do i use a user-define function to calculate the value of e^x or N! in vba in excel.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function myFact(inVal As Long) As Long
If inVal <= 1 Then
myFact = 1
Else
myFact = inVal * myFact(inVal - 1)
End If
End Function
If DY < 0 Then
VBAATan2 = -VBAATan2(DX, -DY)
ElseIf DX < 0 Then
VBAATan2 = Pi - Atn(-DY / DX)
ElseIf DX > 0 Then
VBAATan2 = Atn(DY / DX)
ElseIf DY <> 0 Then
VBAATan2 = Pi / 2
Else
VBAATan2 = CVErr(xlErrDiv0)
End If
End Function