+ Reply to Thread
Results 1 to 10 of 10

unhide (or hide) row based on a filter value

  1. #1
    Registered User
    Join Date
    04-19-2010
    Location
    belgium
    MS-Off Ver
    Office 365
    Posts
    49

    unhide (or hide) row based on a filter value

    Good morning everyone,

    I have an issue i cannot solve for my excel file.. i explain

    I received a file from a company where there is a pivot table with a filter (anyway this is what i think)...

    I would like, based on the value choosen with the filter, to show only the correspondant product linked to this number.. I have insterted a screenshot explaning what i need
    Excel issue.png
    Would you have a solution for me ? (VBA or something else)

    Thanks for your support

    Guismo30

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: unhide (or hide) row based on a filter value

    Can you provide a sample file, with dummy data, refer to the yellow banner above. VBA can be manipulated to hide rows that don't match the filter.

  3. #3
    Registered User
    Join Date
    04-19-2010
    Location
    belgium
    MS-Off Ver
    Office 365
    Posts
    49

    Re: unhide (or hide) row based on a filter value

    Hi
    thanks for your answer, please find attached the file
    Pierre
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: unhide (or hide) row based on a filter value

    after working on this for a bit,I realized that you essentially want to data filter for a single value below row 9 inclusive, like in the diagram below.

    fltr.png
    One method I was considering to code the solution as to implement this filter in VBA. Do you still need a coded solution if you could filter like in the diagram?
    Last edited by maniacb; 07-09-2020 at 10:36 AM. Reason: Corrections to response

  5. #5
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: unhide (or hide) row based on a filter value

    In this version I have added two simple buttons, one to turn ON the filter and another to turn OFF the filter. You would need to select either button after selecting the part. Let me know your thoughts.

    fltr1.png
    Attached Files Attached Files
    Last edited by maniacb; 07-09-2020 at 06:07 PM. Reason: Update Picture

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: unhide (or hide) row based on a filter value

    In this iteration i tied updating c4 with a worksheet_change event so that you don't have to select the turn on button . You'll still need to use the filter off to clear the autofilter. Here is the worksheet change code :
    Please Login or Register  to view this content.
    Here is the filter on and off code:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: unhide (or hide) row based on a filter value

    I hope this is the final iteration. a change event on C4 now hides all other columns. A button exist to reverse the hiding of rows. Maybe this is what you envisioned in the first place. Here is the code and the working file is attached.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: unhide (or hide) row based on a filter value

    If the intention is to show only the Brick numbers that correspond to the value under Filter, then it's better to create a duplicate Brick column in the database and name the column header, say Brick2. Bring Brick2 to the Filters section with Brick remaining in the Rows section of the PivotTable.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-19-2010
    Location
    belgium
    MS-Off Ver
    Office 365
    Posts
    49

    Re: unhide (or hide) row based on a filter value

    Hello Maniacb
    This is what i need thanks a lot for your support !!!

    I however still need additional help from you if you do not mind ...

    As you could see, i have one sheet with attributes per brick (for ex brick 10000443 will have the 4.367, 4.391, 4.700 etc...) but for all the bricks there are fixed attributes that will have to be showing each time we filter the "brick" (like description, dimensions, weight, etc...) .. There are 192 attributes that need to show each time we filter the brick then followed by the "attributes per brick"... ==> as the 192 attributes have no "brick number" i do not know how to add them in the filtering

    Do you understand what i mean ? I have added the 192 in the attached list, would you mind letting me know whether this is something possible?

    Thanks again and regards!
    Pierre
    Attached Files Attached Files
    Last edited by guismo30; 07-13-2020 at 03:04 AM.

  10. #10
    Registered User
    Join Date
    04-19-2010
    Location
    belgium
    MS-Off Ver
    Office 365
    Posts
    49

    Re: unhide (or hide) row based on a filter value

    Hi Josephteh
    not exactly what i wanted but thanks a lot
    Pierre

+ 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. [SOLVED] Hide/Unhide row based on cell value
    By TrenchRT in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-12-2019, 05:26 PM
  2. [SOLVED] Macro to filter, hide, save to pdf, unhide, and repeats again
    By garzal in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2017, 11:58 AM
  3. [SOLVED] How to hide unhide worksheet based on value?
    By putritersenyum in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-24-2016, 10:00 AM
  4. VBA to hide/unhide worksheet based on value
    By ahs004 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2015, 11:55 PM
  5. [SOLVED] Auto hide/unhide row based on row above
    By wjwelch1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2014, 02:10 PM
  6. Hide and unhide based on Value
    By wmadour in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2010, 10:42 PM
  7. Using Hide, Unhide, and auto filter - select all on a protected sh
    By Pattie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-07-2006, 11:47 AM

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