title: Count cells dynamically in macro
body: <p>What can I replace in:</p>
  
  <pre><code>Set Rng = Sheets("Annual SnD Raw Data").Range("J2:J89500")
  </code></pre>
  
  <p>In order for <code>Rng</code> to be the range from <code>J2</code> the last used used cell in column <code>J</code>?</p>
  
  <p>I tried: </p>
  
  <pre><code>Sheets("Annual SnD Raw Data").Range(Cells(2, 10), Cells(2, Application.WorksheetFunction.CountA("J:J")))
  </code></pre>
  
  <p>But it didn't set the correct range. </p>