title: How can I use elseif to fix my code?
body: <p>I have this Excel VBA code that should tell me which sum to pay based on the product, but wether I type "credit" or any other product it skips the first IF statement and gets to the second one.</p>
  
  <p>I'd like to know how I can use else if so it will genarate the right sum.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Dim prod As String
  Dim sumam As Integer
  Dim total As Integer
  Dim rate As Integer
  
  prod = InputBox("Introduceti tipul de produs")
  total = InputBox("Introduceti suma totala de plata")
  
  If prod = credit Then
     If total &lt; 1000 Then sumam = 175
     If total &gt; 1000 And total &lt; 3000 Then sumam = 350
     If total &gt; 3000 And total &lt; 6000 Then sumam = 425
  Else
     If total &lt; 1000 Then sumam = 150
     If total &gt; 1000 And total &lt; 2000 Then sumam = 200
     If total &gt; 2000 And total &lt; 5000 Then sumam = 325
     If total &gt; 5000 And total &lt; 8000 Then sumam = 450
     If total &gt; 8000 And total &lt; 12000 Then sumam = 550
     If total &gt; 12000 Then sumam = 675
  rate = total / sumam
  
  textprod.Text = prod
  textprod.TextAlign = fmTextAlignRight
  texttot.Text = total
  texttot.TextAlign = fmTextAlignRight
  textsumm.Text = sumam
  textsumm.TextAlign = fmTextAlignRight
  textrate.Text = rate
  textrate.TextAlign = fmTextAlignRight
  
  End If
  End Sub
  </code></pre>