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