View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Copy Worksheets from one book to another?

If the sheet doesn't already exist in the second workbook:

With Workbooks("Book2.xls")
Workbooks("Book1.xls").worksheets(1).copy After:= _
.Worksheets(.worksheets.count)
End With

copies it to the end of Book2.xls

--
Regards,
Tom Ogilvy


"Jonx " wrote in message
...
well there is an actual method for copying the worksheets. It goes
something like:

ThisApplication.ActiveWorkbook.Sheets(1).Copy( _
After:=ThisApplication.ActiveWorkbook.Sheets(3))


which will copy worksheet 1 and place it after worksheet 3 from the
same workbook. I tried playing witrh the code to copy it on different
workbooks, and I got an error saying copy method failed


---
Message posted from http://www.ExcelForum.com/