Click here to Skip to main content
969 members (265 online)
Rate this:
 
Please Sign up or sign in to vote.
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? :)
Posted 14-Jul-15 12:18pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 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

Dim Num1 as Integer = 200
Dim Num2 as Integer = 100
 
Dim Result as Integer
 
Result = Num1 - Num2
 
' output result to where ever you want.
'Such as 
 
TextBox1.Text = Result
  Permalink  
v2
Comments
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.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Well you could simply multiply it by -1.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
RA-Web1 | 2.8.171013.1 | Last Updated 12 Sep 2016
Copyright © RootAdmin, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

RootAdmin, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100