title: Calculator won't perform basic arithmetic calculations
body: <p>I am relatively new to VBA and have been trying to learn it. I started by trying to code a calculator and programming it to perform basic calculations such as add, divide, subtract, and multiply. However, when I try to execute those function, using the code seen below, the calculator does not compile and perform the said calculations.</p>
  <pre><code>Private Sub cmdBtnEql_Click()
  
  On Error GoTo ErrOcccered
       
       If txtDisplay = &quot;Cannot divide by Zero&quot; Then txtDisplay = Empty
       
       
       If txtRes &lt;&gt; &quot;&quot; And calVal Then
          FNum = Val(txtDisplay): SNum = Val(txtRes)
          Select Case calVal
              Case &quot;Add&quot;
                  txtRes = FNum + SNum
              Case &quot;Minus&quot;
                  txtRes = FNum - SNum
              Case &quot;Multiplication&quot;
                  txtRes = FNum * SNum
              Case &quot;Divide&quot;
                  If SNum = 0 Then
                      txtRes = &quot;Cannot divide by zero&quot;
                  Else
                      txtRes = FNum / SNum
                  End If
              Case Else
          End Select
      End If
  ErrOcccered:
  
  End Sub
  </code></pre>
  <p>However, this procedure does not actually perform the aforementioned calculations. I am able to click on the buttons and the corresponding numbers do display in the text-box on the user-form, with no calculations done. This code is not mine personally, I am using another code I found online and trying to understand how all the syntax and semantics work within VBA. I appreciate your help! Thanks</p>