Seamus2626
asked on
Application defined or Object error 1004
Hi,
I am getting the above error message on the below code, can anyone suggest a workaround?
Thanks
Seamus
I am getting the above error message on the below code, can anyone suggest a workaround?
Thanks
Seamus
Sub Combine()
'
Dim NumSheets As Integer
Dim NumRows As Integer
' Change the value of NumSheets to equal the number of sheets you wish to combine
NumSheets = 10
' Change the value of NumRows to equal the number of rows in each sheet
NumRows = 500
Worksheets(12).Select
Sheets.Add
ActiveSheet.Name = "Consolidated"
For X = 1 To NumSheets
Worksheets(X + 1).Select
Rows("2:" & NumRows).Select
Selection.Copy
Worksheets("Consolidated").Select
ActiveSheet.Paste
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Worksheets(X + 2).Select
Range("A1").Select
Next X
Worksheets("Consolidated").Select
Range("A1").Select
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Which cell is selected when the macro stops running with the error message?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This question was a favour for a friend who wouldnt provide the data behind it, so im going to close it off
Thanks for all your help
Thanks for all your help
ASKER
ActiveCell.Offset(1, 0).Select
Thanks