cristovam4
New Member
- Joined
- Apr 5, 2015
- Messages
- 2
Hi Friends,
I´ve searching all across Google but haven´t found a solution yet.
I have a workbook with a number of sheets (my projects). They increase and decrease based on my business demands.
I´m trying to consolidate 1 column of data for each sheet in one single sheet, in the same column, one after another.
When i run the macro I get the error 1004. What I´m doing wrong?
I´ve searching all across Google but haven´t found a solution yet.

I have a workbook with a number of sheets (my projects). They increase and decrease based on my business demands.
I´m trying to consolidate 1 column of data for each sheet in one single sheet, in the same column, one after another.
When i run the macro I get the error 1004. What I´m doing wrong?
Code:
[COLOR=#2E8B57][FONT=Monaco]Sub test1()[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Dim ws As Worksheet[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]For Each ws In Worksheets[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]If ws.Name <> "Dashboard" Then[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]ws.Select[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]ws.Application.Run "consolidate"[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]End If[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Next[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]End Sub[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Sub consolidate()[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Range(Range("H2"), Range("H2").End(xlDown)).Select[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Selection.Copy[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Sheets("Dashboard").Select[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Range("A1048576").End(xlUp).Offset(1, 0).Select[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Selection.PasteSpecial[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]Application.CutCopyMode = False[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]End Sub[/FONT][/COLOR]