LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Pivot Filters Incorrectly Sorted on Refresh

I'm using VBA code to extract data from a SQL database. The macro
clears a variable range and repopulates it with current data. Then it
refreshes a pivot table based on the data returned to the variable-
length named range. I am using PivotCache.MissingItemsLimit =
xlMissingItemsNone to eliminate phantom dropdown filter entries which
no longer exist in the underlying data, and that works fine. However,
I recently noticed that entries in the pivot table page and row
dropdown filters are no longer sorted alphabetically. Is there a
coding convention to address the sort order picked up in the pivot
filters?

Here is the current code:

Sheets("General_work").Select
ActiveSheet.AutoFilterMode = False
ActiveWorkbook.Names.Add Name:="OldData", RefersTo:= _
"=OFFSET(General_work!$A$2,0,0,COUNTA(General_work !$A:$A),46)"
Range("OldData").ClearContents

Call RefreshGeneral 'executes SQL DB refresh of General_work
Sheets("General_Pivot").Select

ActiveSheet.PivotTables("GeneralPivot1").PivotCach e.MissingItemsLimit
= xlMissingItemsNone
ActiveSheet.PivotTables("GeneralPivot1").PivotCach e.Refresh

One last comment-- I upgraded to Excel 2007 about 2 months ago, and
did not notice this problem before the upgrade. Prior to that, I'd
been using this code successfully for about 18 months. Don't know if
there's a connection there.

Any ideas on how to fix the page and row field dropdown sort order to
A-Z on the pivot table? Thanks!
--Vicki
 
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
Automatically refresh sorted data Cardian Excel Discussion (Misc queries) 4 February 10th 08 06:35 PM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
refresh a new worsheet on pivot table refresh [email protected] Excel Worksheet Functions 0 February 9th 07 07:39 PM
Pivot Table Sorted chalky Excel Discussion (Misc queries) 0 April 20th 06 02:35 PM
Pivot Table Totals Incorrectly Summed Ms MIS Excel Worksheet Functions 1 January 12th 06 05:27 PM


All times are GMT +1. The time now is 03:37 PM.

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

About Us

"It's about Microsoft Excel"