Hi can anyone figure out why I am getting this message..
run time error '1004' Application-defined or object-defined error
Here is my code, the problem line seems to be:
range("A1").Select
here is the rest 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).Value
ActiveCell.EntireColumn.Select
Selection.Copy
Sheets("input").Select
range("A1").Select
ActiveSheet.Paste
Sheets("output").Select
End If
Next lCol
End Sub
Thank you in advance :)
range("A1").Selectrangeis not with a capital, meaning that VB did not parse it as theRangemethod. Possibly you have to prepend the object of which you want to get a range, e.g.ActiveSheet.Range("A1").Select.Sub HorizontalLoop()), putOption Explicitto make sure your variables are okay. I think you have a variable calledrangesomewhere. Can you post the rest of your code?