+ Reply to Thread
Results 1 to 5 of 5

Removing blanks from pivot table slivers within a macro

  1. #1
    Registered User
    Join Date
    02-03-2014
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    67

    Removing blanks from pivot table slivers within a macro

    I created a macro to create the beginning of a pivot table- just the rows and slicers, because when I tried making a longer macro to create the entire pivot table (formatting, etc) I couldn't get the macro to work.

    So I do get all the vertical rows I want, and I do get all the slicers I want. But I get blank space. I think this is because the pivot table is created from another tab, and the length of data in that tab will vary from file to file (I'm doing another 30 or so of these, all with varying amounts of data, but the same data categories).

    Anyway, I get slicers, but in addition to getting the categories I want, I also get "(blank)" below the names in the slicers. Is there a way to add some code to the macro to remove the blanks so I don't get this field?

    I have copied and pasted the macro below, with identifying data changed.

    Please Login or Register  to view this content.
    Last edited by tnovak; 02-20-2014 at 09:28 AM. Reason: Highlighting code per moderator

  2. #2
    Registered User
    Join Date
    02-03-2014
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Removing blanks from pivot table slivers within a macro

    Sorry, I didn't know about that rule. I've never pasted code here before, and I'm not a programmer so I'm rather a novice at this. Apologies.

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Removing blanks from pivot table slivers within a macro

    It is not possible to remove items from slicer but you may try to change this line:
    Please Login or Register  to view this content.
    to this code:
    Please Login or Register  to view this content.
    This will allow the pivot table to only use the actual data range.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  4. #4
    Registered User
    Join Date
    02-03-2014
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Removing blanks from pivot table slivers within a macro

    This worked!! Thanks so much- this was my first time ever editing code in a macro and you made it very easy. In fact I only started using Macros this week! So thanks again for your help :-) you saved me a lot of time on this project!

  5. #5
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Removing blanks from pivot table slivers within a macro

    You are welcome.

    Please remember to mark thread solved using Thread Tools link at top of this page.

+ 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. Excel 2007 : Removing blanks from a pivot table
    By benoj2005 in forum Excel General
    Replies: 1
    Last Post: 02-16-2012, 07:38 AM
  2. Pivot table counting blanks
    By paulchemguy in forum Excel General
    Replies: 5
    Last Post: 07-17-2011, 04:47 AM
  3. Pivot table with blanks
    By timlocke in forum Excel General
    Replies: 4
    Last Post: 07-15-2011, 02:19 PM
  4. Pivot Table: Removing blanks
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2010, 11:29 AM
  5. Get Pivot Table To Ignore Blanks
    By StevenAFC in forum Excel General
    Replies: 2
    Last Post: 09-11-2007, 05:06 AM

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