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
Barb Reinhardt - 25 Apr 2007 02:50 GMT
Have you tried to right click on the worksheet tab and copy it to the other
workbook?
> Hello
> I spent hours today trying to figure this out. I am trying to copy a
[quoted text clipped - 7 lines]
> TIA!
> Bon
Gord Dibben - 25 Apr 2007 02:50 GMT
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
>Hello
>I spent hours today trying to figure this out. I am trying to copy a
[quoted text clipped - 7 lines]
>TIA!
>Bon
Bob Ford - 25 Apr 2007 03:31 GMT
I forgot to mention that I need it via VBA code. I know how to idt through
shortcuts and via menu.
> Hello
> I spent hours today trying to figure this out. I am trying to copy a
[quoted text clipped - 7 lines]
> TIA!
> Bon
Barb Reinhardt - 25 Apr 2007 13:02 GMT
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
> I forgot to mention that I need it via VBA code. I know how to idt through
> shortcuts and via menu.
[quoted text clipped - 10 lines]
> > TIA!
> > Bon