title: Copy a variable range in excel with VBA macro
body: <p>I am a little confused. I created a button with a macro that copy a selection of cells from another sheet <code>s</code> in my actual sheet <code>s0</code> (both <code>s</code> and <code>s0</code> are string variables)</p>
  
  <pre><code>Sheets(s0).Range("D56:K80").Value = Sheets(s).Range("L2:S26").Value
  </code></pre>
  
  <p>and all works. But If I try to write something more flexible, such as a range that can vary the starting row</p>
  
  <pre><code>x = Cells(2, 4).Value 'x is a number defined by user
  Sheets(s0).Range(Cells(56, 4), Cells(80, 11)).Value = Sheets(s).Range(Cells(2 + x, 2), Cells(26 + x, 9)).Value
  </code></pre>
  
  <p>nothing works and 1004 error appears. What is the problem?
  What am I doing wrong?</p>
  
  <p>The situation does not change if I compute the sums out of the Cells command.
  But something like </p>
  
  <pre><code>Sheets(s).Cells(r, c) = x
  </code></pre>
  
  <p>works when I change the value of a single cell with variabiles values of r and c. (x, r and c are always integer)</p>
  
  <p>Thank you in advance</p>