Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default vba pivot table sorting

is it possible to sort by the grand total column in a pivot table using vba?
what is the proper code to do so?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default vba pivot table sorting

Turn on the macro recorder, then go through the steps of building your pivot
table. After you build your pivot table, double-click on the 'pivot' in the
upper left corner of the pivot table. A screen pops up; click on 'Advanced'
then choose your 'AutoSort Options'.

After you do all that, go back and check your code. You syntax will be
different from mine, but eventually, you should probably get code somewhat
similar to this:
ActiveSheet.PivotTables("PivotTable1").PivotFields (Sheets("Summary").Range("C5").Value).AutoSort _
xlDescending, "Count of "

Just try it and see what happens. You may be pleasantly surprised!!

Regards,
Ryan---

--
RyGuy


"joemeshuggah" wrote:

is it possible to sort by the grand total column in a pivot table using vba?
what is the proper code to do so?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting & pivot table Eva Excel Worksheet Functions 1 November 6th 09 12:24 AM
Sorting in Pivot Table Volkan Cetin Excel Worksheet Functions 1 June 15th 09 02:14 PM
Pivot table not sorting nathan_savidge Excel Discussion (Misc queries) 2 November 4th 08 04:57 PM
Pivot Table Sorting Scott R Excel Worksheet Functions 1 November 8th 07 01:23 AM
Pivot Table Sorting Hammer Excel Programming 2 November 28th 06 09:51 PM


All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"