Combining data in multiple sheets into one sheet

ferijen

New Member
Joined
Nov 16, 2004
Messages
12
I have a multi-sheeted workbook (about 80 sheets I think) where every sheet contains data in the same layout & format: 8 columns wide, although each sheet varies in the number of rows.

I'd like to combine all this data so it is on one sheet - essential a copy/paste action for each sheet in the workbook - but I wondered if anyone else had already written the vb code which would make my task easier? I know that I won't exceed the maximum number of rows when it is all put on to one sheet.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
Hi
paste the following codes in the macro window ( Alt F11)

Code:
Sub collate()
Sheets.Add.Name = "summary"
For a = 2 To Sheets.Count
x = Worksheets(a).Cells(Rows.Count, 1).End(xlUp).Row
d = Worksheets("summary").Cells(Rows.Count, 1).End(xlUp).Row
worksheets("summary").cells(d,1) = worksheets(a).name
b = "A1:H" & x
Worksheets(a).Range(b).Copy
Worksheets("summary").Cells(d + 2, 2).PasteSpecial
Next a
End Sub
run the macro. It will copy A to H from each sheet and pastes to summary sheet.
Ravi
 
Upvote 0

Forum statistics

Threads
1,191,080
Messages
5,984,510
Members
439,894
Latest member
Amba1006

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top