title: VBA: Subscript out of range
body: <p>similar questions have been asked but I think I have a different problem:</p>
  
  <pre><code> Workbooks.Open Filename:=filepath &amp; "PLT.xlsx"
  
  Worksheets("Sheet1").Range(Worksheets("Sheet1").Range("A1:B1"), Worksheets("Sheet1").Range("A1:B1").End(xlDown)).Copy
  Windows("XXX.xslm").Activate
  w1.Range("A4").PasteSpecial Paste:=xlPasteValues
  </code></pre>
  
  <p>The second line is the problem. In fact, it does not copy the cells I want. When I open that workbook, the whole worksheet is selected.</p>
  
  <p>I do not understand why I get that error.</p>