Sub addNumbers()
'Declare the variables
Dim intNumber1 As Integer
Dim intNumber2 As Integer
Dim intSum As Integer
'Create InputBoxes to enter numbers
intNumber1 = InputBox("Enter the first number")
intNumber2 = InputBox("Enter the second number")
'Add numbers
intSum = intNumber1 + intNumber2
' Create an output
Debug.Print "The numbers entered were " & intNumber1 & " and " & intNumber2
End Sub
|