title: Run-time error: 1004 Range of object '_Worksheet' failed
body: <p>Okay here is my code, I'm pretty sure the error is coming from something silly in the way stuff is named.  I'm just starting to learn VBA so totally noob at this and can't catch what's wrong. Any input would be appreciated.</p>
  
  <pre><code>Sub test()
  
  Dim wsInput As Worksheet: Set wsInput = ActiveSheet
  Dim wsOutput As Worksheet: Set wsOutput = Workbooks.Open("C:\output.xls").Sheets(1)
  Dim OutputRowCount As Integer: OutputRowCount = 1
  
      For i = 1 To 10000
       If wsInput.Range("a12" &amp; i) &lt;&gt; "" Then
           wsInput.Range("D12" &amp; i, "E12" &amp; i).Copy
  
         wsOutput.Range("A4" &amp; OutputRowCount).PasteSpecial Paste:=xlPasteValues
      End If
      Next
  
  End Sub
  </code></pre>