+ Reply to Thread
Results 1 to 4 of 4

Limiting a Pivot table to the first 15 entries use VBA

  1. #1
    Registered User
    Join Date
    12-12-2019
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    14

    Limiting a Pivot table to the first 15 entries use VBA

    Good Afternoon
    I am been searching high and low both on the WEB and on this forum for this answer. I have created a complex spreadsheet, 95% completed. The last thing I need to do is to have the pivot tables only show 15 entries. For instance, if there are 40 entries on my table, I only want the first 15 to show, not necessarily the top 15, just the first 15 that comes up. Can someone point me in the right direction please.
    Last edited by CADman1969; 12-20-2019 at 03:24 PM.

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

    Re: Limiting a Pivot table to the first 15 entries use VBA

    It would help if you attach a sample worksheet with source data and the pivot table, and a mock up of the desired result. I will assume that after displaying the 15 rows, that there is nothing else you want to do with the pivot table. That is, you are NOT asking for a dynamic result. In other words, if you change a filter and get new data in the pivot table, you will have to re-run the program again.
    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.

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

    Re: Limiting a Pivot table to the first 15 entries use VBA

    Here is my shot at it.

    Change the Constants to suit your setup.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-12-2019
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    14

    Re: Limiting a Pivot table to the first 15 entries use VBA

    Hello dflak, that is just what I needed. Thank you so much. The purpose for this code is because I have 12 pivot tables on one sheet, each one showing a specific machines upcoming orders, instead of leaving 100+ rows between each table, I wanted to limit the lines to 15 to help keep it clean looking. Right now if any machine exceeds 15 orders I get an error because a pivot table cannot impede into another table. This should work perfectly for what I need, I can't thank you enough.

+ 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. Form validation - Limiting entries
    By stimulus in forum Tips and Tutorials
    Replies: 0
    Last Post: 12-05-2015, 05:14 AM
  2. Limiting a pivot table slicer to one selection
    By behrensf84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2014, 09:25 PM
  3. Limiting number of same entries in a column
    By Johny1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2009, 06:46 PM
  4. VBA for limiting number of similar entries with a pop up box
    By ramakavin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2008, 12:33 AM
  5. Pivot Table limiting data
    By Publius in forum Excel General
    Replies: 4
    Last Post: 06-01-2007, 02:30 AM
  6. Limiting Entries in A List Box
    By Dave C in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-03-2006, 03:00 PM
  7. Replies: 0
    Last Post: 09-27-2005, 07:05 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