Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to copy each worksheet from the active workbook into a new workbook.
I've been fighting with the following code and am hoping can point out my mistake. Set DataWrkBk = Workbooks(ActiveWorkbook.Name) Workbooks.Add Sheets("Sheet1").Select Set NewWrkBk = ActiveWorkbook NewWrkBkName = ActiveWorkbook.Name Windows("Weekly_Stats.xls").Activate For Each ws In DataWrkBk.Worksheets wSheet.Copy After:=NewWrkBk.Worksheets(NewWrkBk.Worksheets.Cou nt) Debug.Print ws.Name Next ws It does the first sheet fine and then spits out an error:424 object required and highlights the wSheet.Copy line? Why would it work once and then stop? Thank you for the helping hand. QB |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy method of worksheet class failed: trying to copy a hidden she | Excel Programming | |||
copy method of worksheet class failed: trying to copy a hidden she | Excel Programming | |||
copy method of worksheet class failed: trying to copy a hidden she | Excel Programming | |||
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 | Excel Worksheet Functions | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming |