copy and paste data (includes groups...)

M

Miri

hi,
i need to copy spesific sheet from one workbook to another existing sheet in
other workbook.
both sheets includes Grouping.
i wrote a code that copy and paste, but the actual result is that the
grouping at the end is not related to the new data i pasted.
what should i add to my code in order to copy also the groups.
my code:

Workbooks(NewBook).Sheets("a").Cells.Select
Selection.Copy
...
Workbooks(Activebook).Sheets("b").Select
Range("A1").PasteSpecial Paste:=xlPasteAll
 
J

Joel

I always do worksheet copies like this

Workbooks(NewBook).Sheets("a").cells.Copy _
destination:= Workbooks(Activebook).Sheets("b").cells


Maybe you just want to delete the old sheet and the copy entiore sheet this
copies more info

Workbooks(Activebook).Sheets("b").Delete
Workbooks(NewBook).Sheets("a").Copy _
after:=Workbooks(Activebook).Sheets(1)
ActiveWorkbook.Name = "b"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top