+ Reply to Thread
Results 1 to 6 of 6

Grouped rows, hide/reveal base on cell value

  1. #1
    Registered User
    Join Date
    08-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    52

    Grouped rows, hide/reveal base on cell value

    Hi,

    I'm looking to expand/hide rows that have been grouped (Data tab, Outline section, Group). What I really want is to be able to group rows, and name them because I have multiple groups I need control over. Then have them expand or hide based on a cell value. For example I want to group row 10 to 20, and if b6 = "Blue" have the rows expand if not have them hidden. Hopefully someone can help me with this I'm not having any luck with google.

    Thanks
    Dave

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Grouped rows, hide/reveal base on cell value

    Upload sample file please (with innocuous/sanitized data).

  3. #3
    Registered User
    Join Date
    08-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Grouped rows, hide/reveal base on cell value

    Okay, it's not much to see, but here you go.
    Attached Files Attached Files

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Grouped rows, hide/reveal base on cell value

    Are you manually grouping or using Subtotal grouping?

    I ask, since it's easier to hide rows if there isn't Subtotal or other calculation done for each grouping.

    Edit: Oh and is there any logic for your grouping? I'll need better representation of your logic and format.

  5. #5
    Registered User
    Join Date
    08-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Grouped rows, hide/reveal base on cell value

    I was manually grouping the rows no need for calculations.

    Ah as for logic I have multiple products, so I was going to create a data table with the product name and a value either a 1 or 0. Then use a vlookup to determine the value, and from that value determine if the group remains compressed or is expanded.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Grouped rows, hide/reveal base on cell value

    Here's what I did with your sample. It's only starting point. You may want to modify as needed.

    Set up:
    1: Data validation source range: S2:S5 (S5 for blank)
    2: Added empty row after each grouping (needed to break each groups)
    3: Formula in T2:T4 to find empty rows in column (each break).
    In T2. Confirmed as array (CTRL + SHIFT + ENTER). Copied down.
    Please Login or Register  to view this content.
    4: In D3 (beside validation cell) following formula
    Please Login or Register  to view this content.
    5: In standard module following code. Rows(#).ShowDetail is used to control individual group.
    Please Login or Register  to view this content.
    6: In Worksheet module (for sheet1 in this case) Me = Activesheet, RowLevels:=2 will expand all, :=1 will collapse all.
    Please Login or Register  to view this content.
    See attached sample.
    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)

Similar Threads

  1. Indirectly show or hide Grouped data rows
    By Rubbertje in forum Excel General
    Replies: 2
    Last Post: 12-02-2013, 11:23 AM
  2. [SOLVED] Please help with this monster! Need help w/VBA codes to hide and unhide rows base on lists
    By SeniaHdz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-16-2013, 12:40 PM
  3. Hide or Unhide Rows base on value in row
    By playtone22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2013, 05:54 PM
  4. [SOLVED] Show/Hide Grouped Rows/Columns
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2012, 01:20 PM
  5. Using a listbox to hide/reveal rows.
    By graveyardshiftee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2012, 12:09 AM
  6. show/hide rows base on value
    By arnab0711 in forum Excel General
    Replies: 3
    Last Post: 06-06-2010, 10:32 AM
  7. Hide/Reveal
    By magneticgravity in forum Excel General
    Replies: 2
    Last Post: 04-09-2008, 06:34 AM
  8. [SOLVED] Hide Row/s (single/grouped) based on cell value of column in the r
    By JB2005 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-27-2005, 05:05 PM

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