title: Excel: Selecting all rows until empty cell
body: <p>I'd to select all rows from 2 adjacent columns, starting with the row below the header (this is fixed) and ending with the row before the first row with a blank cell.</p>
  
  <p>Given the following the example...       </p>
  
  <pre><code>    A       B
  1   Item    Amount
  2   Item1   1
  3   Item2   4
  4           2
  5
  </code></pre>
  
  <p>I'd like to select the range A2:B3. The first row is always row 2, the last row is row 3 because it is the row before the first row with a blank cell.</p>
  
  <p>My goal is to use this selection to automatically sort and add borders to the rows after I've completely filled in the row below the current last row. In this example, I'd have to fill in A4 to make the row part of the selection and apply the aforementioned actions.</p>
  
  <p>I hope anyone can help me.. Thanks in advance!</p>
  
  <p>EDIT</p>
  
  <p>I've come up with a solution, based on chris neilsen's solution:</p>
  
  <pre><code>Dim rng As Range
  With Worksheets("YourSheet")
      Set rng1 = .Range(.Cells(2, 1), .Cells(2, 2).End(xlDown))
      Set rng2 = .Range(.Cells(2, 2), .Cells(2, 1).End(xlDown))
      Set r = Application.Intersect(rng1, rng2)
  
  End With
  </code></pre>