title: VBA - Select Cells from Pivot Table
body: <p>I am quite a novice at VBA and first time posting, so please bear with me. </p>
  
  <p>I am trying to copy data from a pivot table and paste value into a separate worksheet. I need to leave the macro as flexible as possible to cater for any potential future changes to the pivot. In essence I would like to copy (for example) A6:E77, but this row range may need to change (so to A6:E84, rather than A6:G77) if the underlying data changes. I can select all the vertical non-blank cells in a discontinguous data set using:</p>
  
  <pre><code>    Range("A6", Range("A1048576").End(xlUp)).Select
  </code></pre>
  
  <p>However how can I then select all the cells in columns B:E that are alongside the cells chosen in column A? </p>
  
  <p>I have tried using the following code, but it seems to ignore the End.(xlUp) command.</p>
  
  <pre><code>    Range("A6:E1048576", Range("A6:E1048576").End(xlUp)).Select
  </code></pre>
  
  <p>Any ideas? I appreciate the help :)</p>