Results 1 to 6 of 6

Thread: What is the way to Expand/Collapse Grouped Data in a protected sheet of Microsoft Excel

  1. #1
    Join Date
    Nov 2011
    Posts
    57

    What is the way to Expand/Collapse Grouped Data in a protected sheet of Microsoft Excel

    I have created a worksheet that will be distributed to 300+ users in an investment group. It contains formulas and computations in cells that could easily be overwritten by spreadsheet novices, so I've protected the worksheet so users can only edit the cells they need to for the sheet to return the info they need. The problem is: after protecting the worksheet, Excel won't allow the user to expand or collapse grouped rows that list detailed information on each step of the calculations. This is inconvenient because
    I'd like to give the users the ability to expand the spreadsheet to see what's going on, but collapse the extra data for printing purposes. MS Support said that this functionality wasn't available (but it should be), so I'm curious if anyone has ideas for a good workaround.

  2. #2
    Join Date
    Jun 2011
    Posts
    798

    Re: What is the way to Expand/Collapse Grouped Data in a protected sheet of Microsoft Excel

    I modified your workbook slightly, added some code and a couple of buttons from the Forms toolbar. I believe it does what you want.
    1. Insert a row just above "auction items", call it Details and format it
    2. the same as the Summary row.
    3. Clear the outline
    4. Add a button to cell B25 with the caption "Details"
    5. Add a button to cell C25 with the caption "Summary"
    6. Add a module to your workbook and insert the following code

    Code:
    Sub ShowTheDetails()
    ActiveSheet.Unprotect
    If Rows(27).Hidden = True Then
    Rows("27:43").Hidden = False
    Else
    Rows("27:43").Hidden = True
    End If
    ActiveSheet.Protect
    End Sub
    
    Sub ShowTheSummary()
    ActiveSheet.Unprotect
    If Rows(45).Hidden = True Then
    Rows("45:53").Hidden = False
    Else
    Rows("45:53").Hidden = True
    End If
    ActiveSheet.Protect
    End Sub
    7. Assign ShowTheDetails macro to the "Details" button.
    8. Assign ShowTheSummary macro to the "Summary button.

    I will be glad to send you the workbook with the changes in it, if you would like to see it.

  3. #3
    Join Date
    Jun 2011
    Posts
    487

    Re: What is the way to Expand/Collapse Grouped Data in a protected sheet of Microsoft Excel

    I had a very similar requirement with grouped columns. Thanks for the above post it worked fine for me. The only qualification is that someone who knows what they are doing can edit the macro and see your password - not a problem in my case as I am trying to protect the sheet from novices no experts! 'If you already have the outline applied, you can protect the worksheet in code (auto_open/workbook_open??).
    Code:
    Option Explicit
    Sub auto_open()
    With Worksheets("sheet1")
    .Protect Password:="hi", userinterfaceonly:=True
    .EnableOutlining = True
    End With
    End Sub
    It needs to be reset each time you open the workbook. (excel doesn't remember it after closing the workbook.)

  4. #4
    Join Date
    Jun 2011
    Posts
    635

    Re: What is the way to Expand/Collapse Grouped Data in a protected sheet of Microsoft Excel

    You can actually protect the project from most people. Next time you're in the VBE, select that project. Then Tools > VBAProject Properties > Protection Tab But this protection can be broken in a matter of seconds--if the user knows how. But it does keep most out.

  5. #5
    Join Date
    Nov 2011
    Posts
    63

    Re: What is the way to Expand/Collapse Grouped Data in a protected sheet of Microsoft Excel

    I have the same problem like Robert, but I seem not to understand the instructions that you gave . I am not familiar with macro. Is there away it could be done directly with excel or do I have to learn macro. I am using this it works ok but I'm running into a code signing issue now. Shouldn't I be able to sign the macro and have other employees open it without having to obtain a certificate from a "trusted CA" its for internal use only anyway

  6. #6
    Join Date
    Nov 2011
    Posts
    57

    Re: What is the way to Expand/Collapse Grouped Data in a protected sheet of Microsoft Excel

    I'm running on Excel 2007 and I need to enable the end users to expand/collapse columns in a protected sheet Instead of adding VBA language and buttons to run the script backend to ungroup/group columns, is there any other ways in Excel that will facilitate the same process?

Similar Threads

  1. How to do Copy/Paste on protected work sheet in Microsoft Excel
    By Chini mao in forum MS Office Support
    Replies: 1
    Last Post: 14-01-2012, 06:58 PM
  2. how to enable Autofilter and Sorting in Protected Excel Sheet
    By ChittiBabu in forum Windows Software
    Replies: 2
    Last Post: 04-01-2012, 08:38 PM
  3. Parsing data in Excel Sheet
    By Ossi in forum Windows Software
    Replies: 4
    Last Post: 04-02-2011, 07:55 AM
  4. How to expand and collapse columns in Excel
    By Asaph in forum Windows Software
    Replies: 5
    Last Post: 31-08-2010, 11:39 PM
  5. Java program to expand or collapse all JTree nodes.
    By KALIDA in forum Software Development
    Replies: 4
    Last Post: 22-01-2010, 05:04 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
  •  
Page generated in 1,713,584,972.34481 seconds with 17 queries