copy new worksheet

  • Thread starter Thread starter carlos_ray86
  • Start date Start date
C

carlos_ray86

I want to take a worksheet called "data" and make a copy to a closed
workwork called "all data". I tried

Worksheets("data").Copy after:=Workbooks("T:\me\the Data\all
Data").Worksheets(Sheet1)

It doesn't work...Do I have to first open the closed workbook inorder
to copy this worksheet over? Thanks
 
Hi Carlos

Yes you need to open the other workbook first. If you disbale
ScreenUpdating, you can do it without it being obvious the workbook is being
opened:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wb = Workbooks.Open("T:\me\the Data\all Data.xls",UpdateLinks:=False)
ThisWorkbook.Worksheets("data").Copy After:=wb.Sheets(1)
wb.Close SaveChanges:=True

Richard
 
That worked out great! Thanks a bunch.


Hi Carlos

Yes you need to open the other workbook first.  If you disbale
ScreenUpdating, you can do it without it being obvious the workbook is being
opened:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wb = Workbooks.Open("T:\me\the Data\all Data.xls",UpdateLinks:=False)
ThisWorkbook.Worksheets("data").Copy After:=wb.Sheets(1)
wb.Close SaveChanges:=True

Richard








- Show quoted text -

That worked create!
 
Back
Top