Collecting All Data from multiple tabs in excel 2010

philb99

Active Member
Joined
Feb 3, 2014
Messages
410
Office Version
  1. 2013
Platform
  1. Windows
Hi - is there a very quick way to collect all data stored in the same spreadsheet but on multiple tabs and copy them into a new tab please.

All headings are the same in each

Thanks
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Create a sheet and name it "Summary". Place all the headings in row 1. Place this macro in a standard module and run it from there.
Code:
Sub CopySheetData()
    Application.ScreenUpdating = False
    Dim ws As Worksheet, desWS As Worksheet
    Set desWS = Sheets("Summary")
    For Each ws In Sheets
        If ws.Name <> "Summary" Then
            ws.UsedRange.Offset(1, 0).Copy desWS.Cells(desWS.Rows.Count, "A").End(xlUp).Offset(1, 0)
        End If
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0
Thanks but just getting error messages. Compile Error - Expected End Sub

I have created a new tab called "Summary" as advised - just in case all of my other tabs have different names though

What is a standard module please
 
Last edited:
Upvote 0
Hold down the ALT key and press the F11 key. This will open the Visual Basic Editor. In the menu at the top click 'Insert' and then click 'Module'. This will be your standard module. Copy and paste the macro into the empty code window that opens up. Press the F5 key to run the macro. Close the code module window to return to your sheet. There are other quicker ways to run the macro such as assigning it to a button that you would click on your sheet or assigning it to a short cut key. The error you received seems to indicate that the last line of the macro (End Sub) is missing. Please make sure that line is not missing.
 
Upvote 0
Thanks again - I am now getting Run time error 9 - subscript out of range in the grey box

its highlighting the following part of the code with a yellow background

Set desWS = Sheets("Summary")
 
Last edited:
Upvote 0
Do you mean a sheet with that name?
 
Upvote 0
In the macro its your code that is being highlighted my sheet has been set up as "Summary"

Thanks
 
Upvote 0
I think that it would be easier to help and test possible solutions if I could work with your actual file. Perhaps you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0
Hi - I have now just taken out the "" at either end of Summary and all works perfectly - thanks for your help and support. This is just what I wanted - Brilliant
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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
Back
Top