PC Review


Reply
Thread Tools Rate Thread

Copy Columns from Excel Pivot Table in a Macro

 
 
=?Utf-8?B?RGF2ZQ==?=
Guest
Posts: n/a
 
      20th Nov 2006
Does anyone know how to select a column from a pivot table from a macro? I
would like to select a column that corresponds to an attribute of the
horizontal fields. For example, I would like to specify a year as 2006 then
copy the year no matter which column the data for 2006 is located.
 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      20th Nov 2006
Dave,

Something along the lines of

ActiveSheet.PivotTables("PivotTable1").PivotSelect "", xlDataAndLabel, True
Selection.Find(What:="2006", LookAt:=xlWhole).EntireColumn.Copy

The specific "What" to look for depends on your actual year values.

HTH,
Bernie
MS Excel MVP


"Dave" <(E-Mail Removed)> wrote in message
news:E3F45035-06AC-4132-A6AB-(E-Mail Removed)...
> Does anyone know how to select a column from a pivot table from a macro? I
> would like to select a column that corresponds to an attribute of the
> horizontal fields. For example, I would like to specify a year as 2006 then
> copy the year no matter which column the data for 2006 is located.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy a pivot table to another sheet in a macro Aline Microsoft Excel Misc 1 19th Apr 2010 02:17 AM
Macro to Copy Pivot Table Data to Another Worksheet in Same Workbo jeannie v Microsoft Excel Worksheet Functions 6 28th Feb 2008 07:56 PM
Excel 2002 - Pivot Table : How to rearranged columns by draging ? =?Utf-8?B?TXIuIExvdw==?= Microsoft Excel Misc 2 25th Oct 2007 02:49 PM
Excel 2002: Can I sort columns of the Pivot Table ? =?Utf-8?B?TXIuIExvdw==?= Microsoft Excel Misc 2 6th Oct 2007 12:41 AM
Use a Macro to Copy Columns from a Form to a Table =?Utf-8?B?SmFja2ll?= Microsoft Access Macros 1 11th Jun 2004 08:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:59 AM.