Copy paste from multiple worksheets into one sheet

jtodd

Board Regular
Joined
Aug 4, 2014
Messages
194
Hi i have the following code in a workbook that works fine ,but when i copy the code into a new workbook it will not work .
It copies one sheet but does not loop through the other sheets ?
I have made sure that the new workbook has a sheet called Summmary1 , any ideas

VBA Code:
Sub SummurizeSheets()
    Dim ws As Worksheet
    
    Application.ScreenUpdating = False
    Sheets("Summary1").Activate
    
    For Each ws In Worksheets
        If ws.Name <> "Summary1" Then
            ws.Range("A1:l50").Copy
            Worksheets("Summary1").Cells(Cells.Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
            'Set NextCell = Sheet2.Cells(Cells.Rows.Count, 1).End(xlUp).Offset(1, 0
        End If
    Next ws
End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Any chance your code needs line before end of code
VBA Code:
Application.ScreenUpdating = True
 
Upvote 0
is it Summmary1 or Summary1 could be simple as a typo
 
Upvote 0
I ran your code in a test workbook and it worked fine, went through 5 sheets and copied info to the Worksheet called Summary1
 
Upvote 0
Yes i did the same , it was how the sheets were setup , ie no data in A ,
all sorted now , thanks for your help
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

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