When posting code in VBForums, be sure to use [highlight=vb] Your code here [/highlight]. Also if you were to indent your code, you can see all the places where your if statement blocks are and more. Makes it 100 times easier to debug:
vb Code:
Public Function Test(Val1 As Long, Val2 As Long) As Long If Val1 >= 500 Then If Val2 >= 500 Then Exit Function End If Else Test = Val1 + Val2 End If End Sub





Mark Thread Resolved
Reply With Quote