Eurekaonide
Active Member
- Joined
- Feb 1, 2010
- Messages
- 433
Dear All
I am trying to copy data from all sheets in one workbook but NOT copy from the HOME sheet and the Prog_Dep sheet, here is my code it copies but also copies these two sheets that I do not want it too.
Sub CombineData()
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Name <> ("Prog_Dep") Or ws.Name <> ("HOME") Then ws.Select
Range("A1:J25").Copy
Sheets("Prog_Dep").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Next ws
End Sub
I am trying to copy data from all sheets in one workbook but NOT copy from the HOME sheet and the Prog_Dep sheet, here is my code it copies but also copies these two sheets that I do not want it too.
Sub CombineData()
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Name <> ("Prog_Dep") Or ws.Name <> ("HOME") Then ws.Select
Range("A1:J25").Copy
Sheets("Prog_Dep").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Next ws
End Sub