+ Reply to Thread
Results 1 to 2 of 2

Excel Macro to Collapse/Expand grouped rows and columns

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    toronto, ontario
    MS-Off Ver
    Excel 2007
    Posts
    5

    Excel Macro to Collapse/Expand grouped rows and columns

    Hi,
    I have about 20 worksheets that are all grouped the same way.

    Row 17:77 is grouped
    Row 79:159 is grouped
    Row 161:194 is grouped
    Column G:BN is grouped

    I would like to create 2 macros in each sheet so that when I am in the worksheet and I run each one, it would do the following:
    Macro 1 -- collapse Row 17:77 and 79:159 and Column G:BN
    Macro 2 -- collapse Row 17:77 and 161:194 and Column G:BN

    Any insight would be greatly appreciated. Thanks in advance for your time!

  2. #2
    Registered User
    Join Date
    11-29-2012
    Location
    toronto, ontario
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Excel Macro to Collapse/Expand grouped rows and columns

    Sub View_Macro2()
    'Shows only the Detail P&L and the Annual Total
    ActiveSheet.Outline.ShowLevels rowlevels:=1, columnlevels:=1
    Rows("79:159").Select
    Selection.EntireRow.Hidden = False
    End Sub


    Sub View_Macro1()
    'Shows only the Detail P&L and the Annual Total
    ActiveSheet.Outline.ShowLevels rowlevels:=1, columnlevels:=1
    Rows("161:194").Select
    Selection.EntireRow.Hidden = False
    End Sub
    Last edited by magjayeck; 01-28-2013 at 11:06 AM.

+ 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