title: Runtime error 1004 "Method of Range Class Failed"
body: <p>I keep running into an error (which happens with no pattern or percieved reason).  The error occurs when I try to do a pastespecial (formulas or values).  I am curious if there is an alternative way to paste values or formulas in VBA given that the number of rows in the array is variable (1 to ~100).  I have attached the snippet of code below.</p>
  
  <p>'both length and selectionarea are defined as strings</p>
  
  <pre><code>Range("P1").Select
  </code></pre>
  
  <p>'length is a formula in a cell that counts the length of the table</p>
  
  <pre><code>length = ActiveCell.Value
  selectionarea = "B3:CM" + length
  Range("B2:CM2").Select
  Selection.Copy
  Range(selectionarea).Select
  Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
      SkipBlanks:=False, Transpose:=False
  selectionarea = "C2:O" + length
  Range(selectionarea).Select
  Selection.Copy
  Range("BL3").Select
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
      :=False, Transpose:=False
  </code></pre>