title: Ms access VBA select case
body: <p>My code is running on different tables, so each table has different number of rows.</p>
  
  <p>I would like to have <code>SELECT CASE nLine</code> so I can group them to 5 rows.</p>
  
  <p>Where each group while have different code according to row.</p>
  
  <p>row = 1 will have code 1.</p>
  
  <p>row 2 - 4 will have code 2.</p>
  
  <p>row = 5 will have code 5.  </p>
  
  <pre><code>Select Case nLine
      Case 1
         Code 1
      Case 2 - 4
         Code 2
      Case 5
         Code 3
  End Select
  Loop &lt;===Start again from above SELECT CASE
  </code></pre>
  
  <p>So, I need a code to group my rows to 5rows per group. And on each Group, to run this code.</p>