C
Cam
Duane,
I have the following code and it gave me the error below. What do I need to
do to fix the code? The code looks at three different scenerio and return the
calculated result based on the scenerio. Thanks
Public Function MyCalc(O As Integer, P As Integer, _
H As Double, I As Double, J As Double, K As Double, _
L As Double, M As Double, Q As Double, N As Double) As Variant
Dim varReturn As Variant
If O = 1 And P = 2 Then
varReturn = (((H + I) / 60) / L) + (J * (1 - M)) / N
Else
If O = 2 And P = 1 Then
varReturn = (((H + I) / 60) / K) + (J * (1 - M)) / N
Else
If O = 1 And P = 1 Then
varReturn = (((H + I) / 60) * Q + (J * (1 - M))) / N
End If
MyCalc = varReturn
End Function
"Compile error:
Block If without End If"
I have the following code and it gave me the error below. What do I need to
do to fix the code? The code looks at three different scenerio and return the
calculated result based on the scenerio. Thanks
Public Function MyCalc(O As Integer, P As Integer, _
H As Double, I As Double, J As Double, K As Double, _
L As Double, M As Double, Q As Double, N As Double) As Variant
Dim varReturn As Variant
If O = 1 And P = 2 Then
varReturn = (((H + I) / 60) / L) + (J * (1 - M)) / N
Else
If O = 2 And P = 1 Then
varReturn = (((H + I) / 60) / K) + (J * (1 - M)) / N
Else
If O = 1 And P = 1 Then
varReturn = (((H + I) / 60) * Q + (J * (1 - M))) / N
End If
MyCalc = varReturn
End Function
"Compile error:
Block If without End If"