starchildren3317
New Member
- Joined
- May 17, 2011
- Messages
- 6
I am greeted with a Run-Time Error 1004: Application defined or Object defined error message when running the following code:
What I am trying to do is copy the first row of the second, third, and fourth worksheet to the first row of the first worksheet:
The error happens on the Bolded line of code above.
Any ideas what I am doing wrong?
What I am trying to do is copy the first row of the second, third, and fourth worksheet to the first row of the first worksheet:
Code:
Dim UsedInfo As Long
Dim InputRow As String
'Copy the first Row on Sheet 2 into first Row on Sheet 1
With Worksheets(2).Range("A1")
.Range(.Cells(1), .End(xlToRight)).Copy Destination:=Worksheets("AppSelect").Range("A1")
End With
'Count number of cells in row
UsedInfo = ActiveWorkbook.ActiveSheet.UsedRange.Cells.Count
UsedInfo = UsedInfo + 1
InputRow = CStr(UsedInfo)
'Copy the first Row on Sheet 3 into first Row on Sheet 1, Starting where the first copy left off
[B]With Worksheets(3).Range("A1")
.Range(.Cells(1), .End(xlToRight)).Copy Destination:=Worksheets("AppSelect").Range("A" & "InputRow")[/B]
End With
'Count number of cells in row
UsedInfo = ActiveWorkbook.ActiveSheet.UsedRange.Cells.Count
UsedInfo = UsedInfo + 1
InputRow = CStr(UsedInfo)
'Copy the first Row on Sheet 4 into first Row on Sheet 1, Starting where the second copy left off
With Worksheets(4).Range("A1")
.Range(.Cells(1), .End(xlToRight)).Copy Destination:=Worksheets("AppSelect").Range("A" & "InputRow")
End With
The error happens on the Bolded line of code above.
Any ideas what I am doing wrong?