Advertisement

07.21.2008 at 10:24AM PDT, ID: 23582601
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

Change data fields for pivot table

Asked by tglucca in Microsoft Excel Spreadsheet Software

Tags: , ,

I have a workbook where I am using a number of Sumproduct calculations to tabulate different metrics (20) for operations.  Each metric is in it's own column with a field name.  The sheet allow selection of a client from a data validation box and then summarizes for the previous twelve months by each type of account.   The calculation speed is very slow because of all the formulas.  I would like to change these summaries to pivot tables.  

My idea is to create a pivot table with the client for pages, months for column headings, account type for row headings, and each metric as the datafield.  I would like to use VBA to change the datafield to the new metric using a drop down list for selection.   After the selection code would change the datafield and refresh the table.  

I am relatively new VBA and can't quite figure this out.  I tried the macro recorder for this and it generated the following code which I tried to modify.  

    Range("A7").Select
    ActiveSheet.PivotTables("PivotTable5").PivotFields("Sum of Placements"). _
        Orientation = xlHidden
    ActiveSheet.PivotTables("PivotTable5").AddDataField ActiveSheet.PivotTables( _
        "PivotTable5").PivotFields("Payments"), "Sum Of Payments", xlSum

Currently I am testing this with command buttons and get an error when the same button is pressed twice concurrently.  Perhaps I need to remove a datafield before I add one, and not just hide it, or use some error trapping.  I would also like to remove all of the filters that had been applied in the previous step so all data would be displayed.   I would list all of the data fields in the list box in $B$4 and need some code to link the data field selection to the list box.

Which event would contain the code so when the metric is chosen, the process would run.  

The pivot table starts in $A$7

This process would allow one pivot sheet to view each of the metrics with a selection from the list box.  Please let me know if you need additional clarification.

Thanks in advance for your help.
TerryStart Free Trial
[+][-]07.21.2008 at 03:30PM PDT, ID: 22054944

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 03:31PM PDT, ID: 22054950

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 03:53PM PDT, ID: 22055127

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Excel Spreadsheet Software
Tags: Microsoft, Excel, 2003
Sign Up Now!
Solution Provided By: folderol
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.22.2008 at 06:06AM PDT, ID: 22058874

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628