+ Reply to Thread
Results 1 to 2 of 2

Group/Ungroup using a Macro

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Group/Ungroup using a Macro

    Is there a way to Group/Ungroup specific columns using a macro? I want to be able to Group/Ungroup several different column groups (see attached).

    There are two problems, firstly I don't want the gaps between the groups, i.e. I don't want columns D, I and L but without them it is not possible to group in this way because it will just make a single group rather than multiple groups.

    Secondly I would want a different keyboard shortcut for each group so I can be specific about which group to show/hide?

    If this is not possible would a better alternative be to simply achieve the same thing using Hide/Unhide? If so, is it possible to achieve the Hide/Unhide by clicking on a particular cell, in the sample attached perhaps double clicking on A1 to hide Group 1, E1 to hide Group 2 and so on. I'm not sure how Unhide would then work, so maybe a toggle would be better, say Ctrl J toggles Group 1 on and off and then Ctrl M toggles Group 2 on and off. Buttons on the page won't really work owing to the size of the main sheet.

    Unsure if this is even possible...

    Many thanks
    Attached Files Attached Files

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

    Re: Group/Ungroup using a Macro

    Perhaps you could use toggle buttons. Click here to download your file. You can Change the names of the buttons to reflect the columns they hide and unhide.
    Last edited by Mumps1; 04-28-2015 at 03:28 PM.
    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 ungroup/group certain columns and adding to a cell or button
    By sluggerish in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2014, 01:30 PM
  2. Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.
    By Michell Feitosa in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-04-2012, 08:10 PM
  3. Group/Ungroup
    By rz6657 in forum Excel General
    Replies: 1
    Last Post: 03-26-2009, 02:55 AM
  4. Group and Ungroup Macro
    By caliskier in forum Excel General
    Replies: 2
    Last Post: 09-20-2007, 02:31 PM
  5. Help with Group/Ungroup
    By deacs in forum Excel General
    Replies: 3
    Last Post: 01-30-2006, 12:30 PM

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