HushHoney
04-05-2016, 07:24 AM
Hello,
can anyone help me figure out why I am getting this message:
"run time error '1004' application-defined or object-defined error"
the problem line where is shows the error is:
range("A1").select
and here is all of the 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).ValueActiveCell.EntireColumn.Select
Selection.Copy
Sheets("input").Select
range("A1").Select
ActiveSheet.Paste
Sheets("output").Select
End If
Next lCol
End Sub
any help is much appreciated :)
Thanks
H
can anyone help me figure out why I am getting this message:
"run time error '1004' application-defined or object-defined error"
the problem line where is shows the error is:
range("A1").select
and here is all of the 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).ValueActiveCell.EntireColumn.Select
Selection.Copy
Sheets("input").Select
range("A1").Select
ActiveSheet.Paste
Sheets("output").Select
End If
Next lCol
End Sub
any help is much appreciated :)
Thanks
H