title: MACRO VBA - "run time error '1004' application - defined or object defined error"
body: <p>Hi can anyone figure out why I am getting this message.. </p>
  
  <blockquote>
    <p>run time error '1004' Application-defined or object-defined error</p>
  </blockquote>
  
  <p>Here is my code, the problem line seems to be:</p>
  
  <p><code>range("A1").Select</code></p>
  
  <p>here is the rest of the code: </p>
  
  <pre><code>Sub HorizontalLoop()
  Dim lCol As Long
  
  Sheets("output").Select
  
  For lCol = 1 To 100
      Dim inputrange As String
          If Not IsEmpty(Cells(lCol).Value) Then
             inputrange = Cells(1, lCol).Value
             ActiveCell.EntireColumn.Select
             Selection.Copy
             Sheets("input").Select
             range("A1").Select
             ActiveSheet.Paste
             Sheets("output").Select
  
          End If
  
  Next lCol
  End Sub
  </code></pre>
  
  <p>Thank you in advance :) </p>