copy worksheet from one sourceA to sourceB

  • Thread starter Thread starter Bob Ford
  • Start date Start date
B

Bob Ford

Hello
I spent hours today trying to figure this out. I am trying to copy a
worksheet from a workbook (contains groupings and subtotals) to another
workbook. It copies it but it does not retain the groupings (drill-down
effect).

The code I used was based from a recorded macro.

Please advise.
TIA!
Bon
 
Have you tried to right click on the worksheet tab and copy it to the other
workbook?
 
Bob

What method are you using to copy the worksheet?

Right-click on a sheet tab and "move or copy" the entire worksheet?

Or just selecting all cells and copy then paste?

The latter will not retain any data grouping whereas the former will.


Gord Dibben MS Excel MVP
 
I forgot to mention that I need it via VBA code. I know how to idt through
shortcuts and via menu.
 
Let's say you refer to the book you are copying to as aWB and the worksheet
you are copying as oWS. Do this

oWS.Copy After:=aWB.Sheets(aWB.Worksheets.Count)

If you need more assistance, let us know.

HTH,
Barb Reinhardt
 

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

Back
Top