Click here to Skip to main content
1,146 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey , thanks for clicking this , I was wondering how to "minus" a value in Visual Basic? I know you can do "+ 100" but I try "- 100" and it doesn't work , is there ANY way to minus a value in Visual Basic? :)

Well you could simply multiply it by -1.
This is Not the right place to ask these questions, use Code Project.

But since I'm here.
If you are talking about 200 - 100 = 100 then

  1  Dim Num1 as Integer = 200
  2  Dim Num2 as Integer = 100
  4  Dim Result as Integer
  6  Result = Num1 - Num2
  8  ' output result to where ever you want.
  9  'Such as 
 11  TextBox1.Text = Result
ledtech3 12-Sep-16 20:15pm
@chris-maunder What was updated ?
Chris Maunder 13-Sep-16 15:50pm
Just wrapped the code block in PRE tags to colourise it. (I'm sneakily using it to test some new content formatting code we have ;))
ledtech3 13-Sep-16 23:28pm
Ok thanks it has been here for so long I forgot what it looked like.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

RootAdmin, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900