View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Nigel Bushell Nigel Bushell is offline
external usenet poster
 
Posts: 2
Default copying output from pivit tables

On Sun, 06 Jun 2004 10:48:26 -0400, Debra Dalgleish
wrote:

The following code copies the pivot table and formatting to sheet1. To
include the page fields, use TableRange2:

'=========================
Sub CopyPivotTable()
Sheets("Pivot").PivotTables(1).TableRange2.Copy
With Sheets("Sheet1")
.Activate
.Range("A1").PasteSpecial Paste:=xlPasteValues
.Range("A1").PasteSpecial Paste:=xlPasteFormats
End With
End Sub
'==========================

Debra,
Works like a charm!
I didn't realise that you could paste properties in several goes.
I had several attempts at this,each with sysntax only slighlty
different from yours, but still kept getting the full-blown table.

Many thanks indeed.