Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8733303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:37:15+00:00 2026-06-13T09:37:15+00:00

In the source sheet of my pivot table; contains two columns; one for the

  • 0

In the source sheet of my pivot table; contains two columns; one for the names and another for the scores. As the thread title suggests, I want to display all names and their corresponding scores of those with even number scores.

An alternative way to accomplish this is to create a third column and ran an IF formula to check which numbers are odd. And then include this third column to the pivot table and use it as the filter.

But is there a way to do the same without modifying the source?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:37:16+00:00Added an answer on June 13, 2026 at 9:37 am

    You can loop through the pivot items and then divide them by 2 to check if they are even numbers or not and if they are not then simply hide them. See this example. Please amend it to suit your needs. Also, I have not done any error handling. I am sure you can take care of that…

    CODE

    Option Explicit
    
    Sub HideOddNumbers()
        Dim ws As Worksheet
        Dim pvtItem As PivotItem
        Dim pvt As PivotTable
        Dim pvtFld As PivotField
    
        '~~> Change this to the respective sheet
        Set ws = ThisWorkbook.Sheets("Sheet1")
    
        '~~> Change this to the respective pivot name
        Set pvt = ws.PivotTables("PivotTable1")
    
        '~~> This is the column
        Set pvtFld = pvt.PivotFields("Scores")
    
        With pvtFld
            .CurrentPage = "(All)"
            .EnableMultiplePageItems = True
    
            '~~> Loop through all items in the pivot and
            '~~> divide the values by 2 and check if they are even or not
            For Each pvtItem In pvtFld.PivotItems
                If Val(pvtItem.Value) Mod 2 <> 0 Then pvtItem.Visible = False
            Next
        End With
    End Sub
    

    SCREENSHOT

    Before:

    enter image description here

    After:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to copy some columns to another sheet. When i call the copyValuesToRange
I would like to know how to update an existing pivot table data source.
Possible Duplicate: Copy column from one Excel sheet to another Excel sheet I have
Aim to achieve : I want to change the SourceData of the Pivot table.
I have two workbooks (source and target) and I want to copy column A
I'm using Sheet.CopyTo to copy a range of cells from one sheet to another
I'm moving information from one sheet to another sheet based off of values in
From the current workbook, I want to open a sheet in the source workbook,
I am trying to figure out how to update my pivot table source data
I'm attempting to copy three sheets (two sheets are pivot tables, one is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.