+ Reply to Thread
Results 1 to 3 of 3

Pivot table comma style.

  1. #1
    Registered User
    Join Date
    11-24-2015
    Location
    london
    MS-Off Ver
    10
    Posts
    33

    Pivot table comma style.

    I have a pivot table and I would like to add the comma style formatting to the pivot table, however it doesn't work and I'm not sure the reason why.

    The last line of my code is the formatting of the comma style, please can someone advise? I've attached my excel sheet.

    Please see my code below:



    HTML Code: 
    Attached Files Attached Files

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,260

    Re: Pivot table comma style.

    You've got two lines on one line there which won't work. There's no point applying a comma style to anything other than the data range so you could use:

    Please Login or Register  to view this content.
    Your code would be a lot neater if you used a variable, or With statement, for the pivot table object, by the way.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Pivot table comma style.

    I cleaned up the code a bit as rorya suggested. and put in his change also
    It looks like recorded code (which is fine) with all those linebreaks dating back to times 80 characters was all a screen could handle..

    linebreaks in the code can be usefull for real long statements, but indentation on those lines and allowing more characters on 1 line can make code a lot more easy to read.

    also maybe this page (one of many) might help you in the last part to use loops to hide details of a lot of pivotitems
    https://www.contextures.com/xlPivot03.html


    HTML Code: 
    Last edited by Roel Jongman; 04-10-2021 at 03:02 PM.

+ 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. Add banded rows to custom pivot table style
    By stephme55 in forum Excel General
    Replies: 0
    Last Post: 11-10-2016, 07:39 PM
  2. [SOLVED] Transform Data From Pivot Style to a Table Style
    By The_Snook in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-18-2016, 04:13 AM
  3. Create Pivot-style table without using a pivot
    By myslin in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-26-2013, 01:08 PM
  4. pivot table from Power Pivot not displaying thousand separator/comma
    By Paul-NYS in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2013, 01:05 PM
  5. Pivot Table Style design
    By whoiswct in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-26-2012, 11:47 PM
  6. cannot save a new default pivot table style
    By jrussell in forum Excel General
    Replies: 1
    Last Post: 06-17-2009, 11:23 AM
  7. Pivot table Format Style Sheet Capability
    By Dave Shafer in forum Excel General
    Replies: 1
    Last Post: 01-29-2005, 05:06 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