New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Excel Pivot

Macros, VBA, Excel Automation, etc.

Excel Pivot

Postby rqd » Tue Dec 27, 2011 3:05 pm

I have 200 plus worksheet and each have the same pivot tables, I need to sort the pivot field in ascending order and I was wondering how I can do this via a macro or vb. I tried recording a macro but it errors out.

Keyboard Shortcut: Ctrl+a
'
ActiveSheet.PivotTables("PivotTable101").PivotFields("CPT").AutoSort _
xlAscending, "CPT"
  • 0

rqd
Rookie
 
Posts: 1
Joined: Dec 27, 2011
Reputation: 0

Re: Excel Pivot

Postby Sisyphus » Mon Jan 02, 2012 3:16 am

Hello Don,
You know your way with pivot tables. Has this post escaped your notice? :D
Happy New Year!
  • 0

Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010

Re: Excel Pivot

Postby Don » Tue Jan 03, 2012 11:18 am

Lol, answer = yes sisyphus ;)

I have not seen a good answer to this question anywhere and have not got a nice macro to do this. The one response to a similar question that emergingtech provided on here was this:

Try creating a Slicer connected to the field in the pivot table you want to filter. Slicers are visual filter boxes created for Excel version 2010.


Not sure if that will be of much help. Once I have a macro that will do this well, I will definitely post it on it's own page along with a description of how to use it.
  • 0

Don
Moderator
 
Posts: 733
Joined: Dec 4, 2011
Reputation: 2
Excel Version: 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: No registered users and 233 guests