title: Excel VBA: Easy If function doesn't seem to work properly
body: <p>here's the code which I check for before executing an UserForm:</p>
  
  <pre><code>If Sheets("Warehouse").Cells(ProdID + 1, 3) &lt; SalesQ.Text Then
      MsgBox ("Not enough quantity - ID: ") &amp; ProdID.Text
      Exit Sub
  End If
  </code></pre>
  
  <p>(If it succeeds, the Q is deducted from the sheet.)</p>
  
  <pre><code>Sheets("Warehouse").Cells(ProdID + 1, 3) = Sheets("Warehouse").Cells(ProdID + 1, 3) - SalesQ.Text
  </code></pre>
  
  <p>Basically I have 2 sheets - Warehouse and Sales, I insert data in Warehouse sheet with a userform code which is smth like (if you need more, let me know):</p>
  
  <pre><code>Cells(emptyRow, 1) = IDBox.Text
  Cells(emptyRow, 2) = prodBox.Text
  Cells(emptyRow, 3) = QBox.Text
  </code></pre>
  
  <p>So the issue is, after I have FIRST inserted the data in Warehouse sheet. Whenever I test out the selling in Sales part, it tells me Not enough quantity even though there is quantity. Now let's say the Q = 100, the Sales userform won't work if I enter 90, 80, 60, etc. but will work if I enter some small number like 20 or 10... After the initial deduction with small number like 10 or 20, it will work perfectly with any other number like 80 etc. I assume it's something with the endings like (.Text, .Value etc? but IDK) Halp.</p>