title: How to copy variable range vba
body: <p>My table contains variable number of rows and three columns (A:C) that I am interested in</p>
  
  <pre><code>    A   B   C  D
  1  xx  xx  xx  xxx
  2  ....
  3  ....
  4  ...
  </code></pre>
  
  <p>I need to copy from <code>WorkSheet1</code> to <code>WorkSheet2</code> </p>
  
  <pre><code>ws2.Range("A1").Value = ws1.Range("A1:C4").Value
  </code></pre>
  
  <p>The problem is that I do not want to hardcode <code>C4</code> , because it can be <code>C5</code> or   <code>C20</code> . How can I account for possible variable number of rows.</p>
  
  <hr>
  
  <p>PS : I cannot use <code>Range("A1").CurrentRegion</code> because this will select more columns than needed, i.e. column <code>D</code> values will also get selected. Although it will select the correct number of rows</p>