+ Reply to Thread
Results 1 to 15 of 15

Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Im a beginner macro user and Im trying to use a macro to Group my table.

    The trick is, I would like to keep my TABLE grouped, if I add or Delete a row in the specific table, it could include or exclude that row to the table group.


    Also I need a macro to expand/Collapse group for a specific table.


    I'd Attached my worksheet to be more clear what I'm doing.

    ps. my sheet is protect as well, pin=150480


    Could you help me, please.


    Thanks in advance


    Michell Feitosa
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Hi, Michell. That's just an example for the sheet Weekly
    But I'm not sure that the macro will run on Mac OS.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Nilem,

    You have no Idea how you saved my life, even though I've done
    52 tables with 52 macros for my Weekly sheet,
    26 tables and 26 macro for my fortnight sheet and
    12 tables 12 macros for my monthly sheet,
    I'm really happy to restart my work again making only one macro for each sheet as you show me in your reply. Thanks God you are here!!!

    Ps. Just one more thing

    How can I Expand/Collapse those tables? Once my sheet is protected, the user can not just click on it.
    Should I create another macro to Expand/Collapse those tables in the same way the macro Add/Del row do?

    Thanks a million one more time

    Michell Feitosa

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Hi Michell, let's give up Group/Ungroup (see attached file)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Hi Nelem, I might be inconvenient, but somehow can we Expand/collapse in the same way as Add/Del row, I mean, selecting the table and then expand/collapse the selected table only.

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    There are the "Collapse All" and "Expand All" buttons to expand/collapse all the tables at once. Double-click the cell with the "Weekly Start:" (A7 or A19 or A30 in example file) to collapse/expand a certain table. Is this not working for you?

  7. #7
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    The double-click doesnt work for me, I'll try tomorrow in a Microsoft window computer.

  8. #8
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    OMG this is unbelievable, works perfect.
    I just have to add the command to protect/unprotect sheet to make it works after run add/del row.
    Could you just check if I'd included it to the corrected place?
    You know, it works now, but I'm not sure if it will continuous work after including 52 tables.

    And yes, somehow it doesn't work in my mac.
    Attached Files Attached Files

  9. #9
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    try to use the "userinterfaceonly" parameter
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Nilem, you are the best as always, thanks for your time!

  11. #11
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Nilem,

    One more question,

    Which cod do I need to write to make the "add/del row" macro do no exclude the last row in the table?

    Thanks
    Michell

    Thanks

  12. #12
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Hi, Michell.
    What do you mean? Can you show an example of a file.

  13. #13
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Hi,

    To add or delete table row, we need to selecte the table, then click on the button add/del row, but if the table has only one row left, and the user still delete it, the table will no longer existe.

    So, how to make the macro to do not delete the last row left on the tables?

    Thanks
    Attached Files Attached Files

  14. #14
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    try
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    09-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2011
    Posts
    18

    Re: Macro to Group/Ungroup a specific Table plus macro to expand/Collapse grouped table.

    Marvellous!

    Thank you!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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