title: VBA Select Case number to number greater than and less than
body: <pre><code>Sub ss()
    Dim a As Double
    a = 6.99999999
    Select Case a
      Case 0 To 7:
        MsgBox "ok"
      Case Else:
        MsgBox "no"
    End Select
  End Sub
  </code></pre>
  
  <p>The <code>Case 0 to 7</code> results in a check for <code>a &gt;= 0 and a &lt;= 7</code>. But what I want is <code>a &gt;= 0 and a &lt; 7</code>.</p>
  
  <p>I also tried <code>Case Is &gt;=0, Is &lt; 7</code>.</p>
  
  <p>How can I do this in a <code>Select Case</code>?</p>
  
  <ul>
  <li><code>a = 6.99999999</code> should result in "ok"</li>
  <li><code>a = 7</code> should result in "no"</li>
  </ul>