+ Reply to Thread
Results 1 to 5 of 5

Help changing Pivot table from Count to Sum

  1. #1
    Registered User
    Join Date
    08-13-2009
    Location
    Glasgow
    MS-Off Ver
    Excel 2016,2016,365
    Posts
    92

    Help changing Pivot table from Count to Sum

    Hello All,

    I have the following code which brings out the count on a pivot table, I read you can't just do xlSum so I found some other code online ( at the bottom)'Commented out, which I ran as a seperate macro which does change it to Sum but the results are just Zeros. Any Ideas?
    Thanks

    Ross

    Please Login or Register  to view this content.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Help changing Pivot table from Count to Sum

    You can do a sum in the code simply by replacing xlCount with xlSum. If Sum returns 0, then your data is actually stored as text.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    08-13-2009
    Location
    Glasgow
    MS-Off Ver
    Excel 2016,2016,365
    Posts
    92

    Re: Help changing Pivot table from Count to Sum

    I right clicked on total absence days and format of the cells is number. If I just do a pivot table manually it works.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Help changing Pivot table from Count to Sum

    Cell format does not necessarily reflect its content. Are you using exactly the same source range for the manual pivot as for the code created one? If so, can you post a sample workbook for testing?

  5. #5
    Registered User
    Join Date
    08-13-2009
    Location
    Glasgow
    MS-Off Ver
    Excel 2016,2016,365
    Posts
    92

    Re: Help changing Pivot table from Count to Sum

    Managed to do it by adding. Thanks for your help.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Pivot table filter not changing data in table - Using macro
    By DJDRU in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-09-2016, 06:16 AM
  2. [SOLVED] Pivot-table changing with changes to pivot chart
    By JackSmith123 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-05-2015, 08:13 AM
  3. Changing a pivot chart column color based on the pivot table category
    By Shawne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2014, 09:12 AM
  4. [SOLVED] Dynamically Changing Position of Pivot Based on Size of Another Pivot Table
    By ggilzow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2013, 02:42 PM
  5. Replies: 2
    Last Post: 02-11-2012, 09:33 PM
  6. Pivot table, changing the criteria in the parent table
    By James_SF in forum Excel General
    Replies: 3
    Last Post: 04-22-2011, 09:04 AM
  7. Changing Name Of Pivot Table
    By McNulty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2009, 06:28 PM

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.6.0 RC 1