+ Reply to Thread
Results 1 to 2 of 2

Select One Item PivotTable VB

Hybrid View

  1. #1
    Registered User
    Join Date
    09-24-2007
    Posts
    60

    Select One Item PivotTable VB

    I have a field called FIELD 1 which is dates. Every week a spreadsheet is imported to the sheet and adds dates to the item list. I want to select ONLY "blanks". Right now I see if I record my action it does a clear filter, and then turns visible to false for all Items, BUT I can not have this as each week new Items are added. So how do I only select the item "blanks".

    I thought the easiest route would be turn off ALL then select "blank" as visible, but I do not know how to turn off ALL
    thanks
    Last edited by elfvis; 01-04-2012 at 10:40 PM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Select One Item PivotTable VB

    Change the below code to reflect the correct values in your pivot -
    Dim pi As PivotItem
        
    For Each pi In ActiveSheet.PivotTables("PivotTable1").PivotFields("Field 1").PivotItems
        If pi.Value <> "(blank)" Then
            pi.Visible = False
        End If
    Next pi
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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