+ Reply to Thread
Results 1 to 2 of 2

Formatting a Pivot Table Field (VBA)

  1. #1
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Formatting a Pivot Table Field (VBA)

    Excel pivot tables do not always maintain the formatting of a field. For example, you may desire that the contents be centered but when the pivot table is refreshed or filtered Excel may decide to left justify some of the contents while leaving other content centered leading to a snaggled-toothed and unprofessional appearance. This macro forces the field back into submission.

    It has 5 parameters
    - SheetName = the name of the sheet containing the pivot table
    - PivotName = the name of the pivot table containing the field to be formatted
    - FieldName = the name of the field to be formatted
    - HAlign (Optional) = the desired horizontal alignment
    - VAlign (Optional) = the desired vertical alignment

    Please Login or Register  to view this content.
    It is suggested that this macro be called with an Update Pivottable event.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  2. #2
    Registered User
    Join Date
    06-15-2018
    Location
    North Carolina
    MS-Off Ver
    16.14.1
    Posts
    7

    Re: Formatting a Pivot Table Field (VBA)

    thanks for this!!!

+ 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. Replies: 0
    Last Post: 08-15-2016, 02:07 PM
  2. formatting multiple field in pivot table
    By stephme55 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-08-2016, 07:49 PM
  3. Formatting - Calculated Field in Pivot Table.
    By thabounceisback in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-01-2013, 11:04 AM
  4. I must enable PIVOT TABLE default field selection formatting
    By miekoo in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-28-2013, 03:41 PM
  5. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  6. Replies: 3
    Last Post: 03-03-2012, 12:16 PM
  7. [SOLVED] Conditional Formatting of Pivot Table Field
    By jdanderson02 in forum Excel General
    Replies: 2
    Last Post: 02-09-2006, 04:45 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