+ Reply to Thread
Results 1 to 2 of 2

to use VBA to expand and collapse entire rows

  1. #1
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    to use VBA to expand and collapse entire rows

    Hi

    I need some a couple of vba help with the attached workbook. Help will be greatly appreciated.

    Fort the first part
    1. Cell B8 is double clicked, entire rows from 9 to 13 is to be collapsed. If double clicked again it should be able to expand.
    2. Cell B14 is double clicked, entire rows from 15 to 20 is to be collapsed. If double clicked again it should be able to expand.
    3. Cell B21 is double clicked, entire rows from 22 to 27 is to be collapsed. If double clicked again it should be able to expand.

    The second part can I check is it possible for the rows in between to auto sort by status in column m. The function should keep open items at the top followed by completed items below within the group. I have tried this before and it didn’t quite work out and am not sure if it’s because of the collapsible/expandable hidden function. If part2 is not possible it’s ok.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: to use VBA to expand and collapse entire rows

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Double click in the cell.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

+ 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. Macro to toggle Pivot - Collapse/Expand entire field
    By rasonline in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-10-2024, 02:05 PM
  2. [SOLVED] How to get drop-like(V) collapse-expand in grouped rows.
    By Excelforum*ser_mH7 in forum Excel General
    Replies: 3
    Last Post: 04-20-2018, 02:14 AM
  3. Expand/Collapse groups of rows with summary line at the top
    By Rob Kennedy in forum Excel General
    Replies: 4
    Last Post: 04-07-2016, 07:50 AM
  4. Macro to expand and collapse rows based on criteria in cells
    By jholiday78 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2015, 10:32 AM
  5. Expand/Collapse Entire Items in a Field in Excel 2007
    By ExcelTip in forum Tips and Tutorials
    Replies: 5
    Last Post: 06-08-2015, 07:52 AM
  6. How to expand and collapse (unhide and hide) rows in a tree like structure
    By Scott N in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-21-2013, 05:57 PM
  7. Expand/Collapse Rows
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-18-2006, 04:30 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