Skip to content

Instantly share code, notes, and snippets.

Created April 30, 2013 23:26
Show Gist options
  • Save anonymous/5492691 to your computer and use it in GitHub Desktop.
Save anonymous/5492691 to your computer and use it in GitHub Desktop.
Module Module1
Sub Main()
Dim User, Number1, Number2, AddOutPut, SubtractOutPut, MultiplyOutPut As Integer
Dim Total, Y, N As String
User = InputBox("Please Choose two numbers 1 = Add 2 = SubTract 3 = Multiply")
Number1 = InputBox("Please Enter The Value For The First Number")
Number2 = InputBox("Please Enter The Value For The Second Number")
AddOutPut = Number1 + Number2
SubtractOutPut = Number1 - Number2
MultiplyOutPut = Number1 * Number2
If User = 1 Then Call Add(Number1, Number2)
If User = 2 Then Call Subtract(Number1, Number2)
If User = 3 Then Call Multiply(Number1, Number2)
Total = InputBox("If you would like to keep going then type Y for Yes or N for No")
Do
User = Y
Loop
Do Until User = N
Loop
End Sub
Sub Add(ByVal Number1, ByVal Number2)
MsgBox("The Total is " & (Number1 + Number2))
End Sub
Sub Subtract(ByVal Number1, ByVal Number2)
MsgBox("The Result Of Subtraction Is " & (Number1 - Number2))
End Sub
Sub Multiply(ByVal Number1, ByVal Number2)
MsgBox("The Result Of Multiply is " & (Number1 * Number2))
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment