title: How to select and copy upto Last cell when uneven Dynamic data's with VBA
body: <pre><code>input:
  
  45311       
  0003ML00030-1   0003ML00030-2   0003ML00030-3
  0003ML00030-1   0003ML00030-1 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/14WKu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/14WKu.png" alt="See my snap highlighted area need to select"></a></p>
  
  <p>See my snap highlighted area need to select, Last cell some times Blank and Also dynamic.</p>
  
  <p>From the Above input, need to select All data and copy it. 
  When i reuse the sheet The Data Range may vary, at the time standard formula not working properly.</p>
  
  <p>Currently i use this VBA code.</p>
  
  <pre><code>Sub Macro()
   Sheets("input").Select
  Range("D2").Select
     Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
     Selection.Copy
  End Sub
  </code></pre>
  
  <p>When i use this code it select Extreme last cell (row 1048570 x col 41).</p>
  
  <p>But in this case Last cell is (row4 x col7)
  like this way i need to select Dynamically if Data range vary</p>