hello friends
ithe vba is really new to me and I need some help.
I did a simple sub that call to a function and it's not working
can someone see what is the problem with it?
thanks a lot
Sub targillesson2()
Dim I, ANSWER As Integer
I = InputBox("chose a number for function")
ANSWER = CHOOSE
Debug.Print ANSWER
End Sub
Function CHOOSE(A, B)
Dim RESULT As Integer
Dim A, B As Integer
A = 5
B = 7
If I = 1 Then
RESULT = A + B
If I = 2 Then
RESULT = A * B
If I = 3 Then
RESULT = A - B
If I = 4 Then
RESULT = A / B
End If
CHOOSE = RESULT
End Function
Bookmarks