+ Reply to Thread
Results 1 to 2 of 2

Pivot filters to hide certain rows

Hybrid View

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    Espoo, Finland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Pivot filters to hide certain rows

    Hi all!

    I'm having some trouble figuring out how to use the filters to get the view I want.. I think the solution is simple, however couldn't figure it out yet....
    Attached is an example. In my original file I have multiple companies and multiple customers. What I would like to do is hide the customer rows that have no data in them - however to still display other customer data for that company. If I use filter, it will filter all the companies too, which have no certain customer data. What options should I choose? I did a macro that hides all empty rows, but i'm pretty sure the pivot table can handle this kind of task... I just don't know about it. Thanks for your help!!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Pivot filters to hide certain rows

    Probably have to go with VBA

    Sub HideRows()
    Dim LR As Long, i As Long
    
    With Worksheets("Pivot")
    LR = .Cells(Rows.Count, 1).End(xlUp).Row
        For i = 5 To LR
            If Not UCase(Left(.Cells(i, 1), 6)) = "COMPAN" And WorksheetFunction.Count(.Cells(i, 2).Resize(1, 3)) = 0 Then
                .Rows(i).Hidden = True
            End If
        Next i
    End With
    End Sub
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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