How do u add 2 numbers together and how do u subtract two numbers!
Printable View
How do u add 2 numbers together and how do u subtract two numbers!
Add: Val(number1) + Val(number2)
Subtract: Val(number1) - Val(number2)
1) You don't need to use Val, unless you are converting from a String.
2) You need the value to be assigned to another variable.
Code:'Add
Num3 = Num1 + Num2
'Subtract
Num3 = Num1 - Num2
I don't think it'd matter though. Only reason I put Val was because number + number or number - number doesn't always give the right result. Ever see that problem before, Megatron?
And I do know that it has to be assigned to something else. Not always a variable.
msgbox num1 + num2
But he just wanted to be shown how to add and subtract.
VIP3R: Amnesia? :rolleyes: