title: VBA If True add one value to another
body: <p>I'm in the process of learning VBA so I am pretty brand new to it. I am creating a dice game to just get practice and tinker with the code. I'm trying to find a way to either add or subtract the amount the user bets from the amount of money he has. So if he guesses closer to the dice rolled, he would win and win the amount of money he has bet and it would get added to his balance. My problem is trying to figure out how to add or subtract the bet amount from the balance. I'm trying to use an If statement that says if Player wins add bet to balance and if he loses subtract bet from balance. What is the best way of doing this in VBA? Thanks for any help you offer.</p>
  
  <pre><code>Sub CommandButton1_Click()
  Dim bet As Integer
  Dim balance As Integer
  Dim player As Integer
  Dim computer As Integer
  
  bet = Range("B11").Value
  balance = Range("A14").Value
  player = Range("A19").Value
  computer = Range("L19").Value
  Range("D14").Value = 5000
  
  Beep
  
  If bet &lt; balance Then Worksheets(1).Calculate
  If player &lt; computer Then MsgBox "You Won!"
  If player &gt; computer Then MsgBox "You Lost!"
  If player = computer Then MsgBox "It's a Tie!"
  
  If player &lt; computer Then Range("D14").Value bet
  
  If player &gt; computer Then
  
  End Sub
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ZncnC.jpg" rel="nofollow noreferrer">Game and Code</a></p>
  
  <p>Edit: Added Code</p>