W
will12985
I need some help improving the efficiency of an if statement in VBA. I can
do a nested if statement in excel and the formula takes no time to change
when an input is changed. I need to add more conditions so I am at the
extent of my nested if skills. The function is:
Function MertonA(IsCall, IsAmerican, Price, Exercise, u, d, n, RowCount,
ColumnCount)
If IsCall = True And IsAmerican = True Then
Formula 1
ElseIf IsCall = False And IsAmerican = True Then
Formula2
ElseIf IsCall = True And IsAmerican = False Then
Formula3
ElseIf IsCall = False And IsAmerican = False Then
Formula4
End If
End Function
Each formula is about 2 lines so I omitted it for brevity. The function is
pasted in a 100 x 100 range and takes about 20 seconds to update completely.
Help would be appreciated.
do a nested if statement in excel and the formula takes no time to change
when an input is changed. I need to add more conditions so I am at the
extent of my nested if skills. The function is:
Function MertonA(IsCall, IsAmerican, Price, Exercise, u, d, n, RowCount,
ColumnCount)
If IsCall = True And IsAmerican = True Then
Formula 1
ElseIf IsCall = False And IsAmerican = True Then
Formula2
ElseIf IsCall = True And IsAmerican = False Then
Formula3
ElseIf IsCall = False And IsAmerican = False Then
Formula4
End If
End Function
Each formula is about 2 lines so I omitted it for brevity. The function is
pasted in a 100 x 100 range and takes about 20 seconds to update completely.
Help would be appreciated.