+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    10-27-2009
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    5

    Pivot Table Field Settings

    I have a ton of data fields that contain some blank cells, which cause the field to use "Count" as the default. I need it to Sum and resetting each field is taking forever. Is there a way to change the default to "Sum" or change the setting to more than one field at a time. (When I try to change multiple field settings, only the first one is changed.)

    Thanks,
    droach

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Pivot Table Field Settings

    Assuming all the fields already exist in the Data Field section of your PT

    Code:
    Public Sub SET_PTFIELDS_TO_SUM()
    Dim PT As PivotTable, PTField As PivotField
    Set PT = ActiveSheet.PivotTables(1)
    For Each PTField In PT.DataFields
        PTField.Function = xlSum
    Next PTField
    Set PT = Nothing
    End Sub
    alter that above in red as appropriate

  3. #3
    Registered User
    Join Date
    10-27-2009
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Pivot Table Field Settings

    Thanks for the reply. I'm a moderate Excel user...

    Is what you posted the code for a macro I can run? I tried to run it in the VB editor but is keeps saying that I need an "object". Any ideas?

    Thanks in advance for your help.

    droach

  4. #4
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Pivot Table Field Settings

    On what sheet is the Pivot Table resident ? What is the Pivot Table called ?

  5. #5
    Registered User
    Join Date
    10-27-2009
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Pivot Table Field Settings

    The sheet is called "Pivot" and the work book is called "Buyer_Recap_DR1
    ". I don't think I named the actual Pivot Table. Is there a default? Where would I find the name?

    Thanks,
    droach

  6. #6
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Pivot Table Field Settings

    To ascertain the name of the Pivot Table, right click on it and select Table Options the first box should detail the name.

  7. #7
    Valued Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    291

    Re: Pivot Table Field Settings

    download this addin. It will allow you to change the entire pivot table to count, sum, etc in just a few clicks. It is on the contextures excel site.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0