+ Reply to Thread
Results 1 to 3 of 3

Ungrouping Rows in Protected WorkSheet

  1. #1
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Ungrouping Rows in Protected WorkSheet

    I have a worksheet that has a few sections of grouped rows to make it easier to view and print, and this worksheet is protected to stop users from messing up formulas, etc.

    and I created a custom protection script that adds this when protecting the sheet

    Please Login or Register  to view this content.
    And this partially works. I can lock the worksheet with the script, and then ungroup and group those rows.

    But when I close and reopen the file, those rows can no longer be ungrouped?

    A google search mentioned using a workbook open like this:

    Please Login or Register  to view this content.
    But with that code, when open the workbook, you are prompted to unlock the workbook.

    Anyone have any advice on how to group and ungroup rows in a protected workbook?

    Thanks,
    PT

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Ungrouping Rows in Protected WorkSheet

    So you would like people to be able to use the Group and Ungroup Icons on the sheet to expand but you don't want them to be able to access or change the cells in the rows which are grouped?
    Please do add reputation where you see fit, it's nice to be nice and we all enjoy a pat on the back

    Please also mark your thread as solved once it has been.

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Ungrouping Rows in Protected WorkSheet

    Quote Originally Posted by PFDave View Post
    So you would like people to be able to use the Group and Ungroup Icons on the sheet to expand but you don't want them to be able to access or change the cells in the rows which are grouped?
    Yes and No. I am only grouping and ungrouping the rows for visual and printing purposes. ie, rows 1 to 60 would be page 1, and rows 70 to 120 grouped and page 2. So the user can ungroup the additional rows and enter additional information (in certain unlocked cells and columns) if they need to for page 2.

    But not sure why after using the above code when locking the sheet, that it stops working when I reopen the workbook.

    I can put this in a workbook open to force it and this will work letting the user ungroup the rows and enter the additional data in the unlocked cells, but it also forces me to put the password in plain text.

    Please Login or Register  to view this content.
    Well. I ended up just going with the above, but then thought to password protect the actual code. It will keep the average work user from trying to unlock the worksheets. But anyone who really wanted to could just google how to break a vba password pretty easily.
    Last edited by ptmuldoon; 07-11-2019 at 12:24 PM.

+ 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. VBA to allow grouping and ungrouping in protected sheet
    By ziyan89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2017, 11:15 AM
  2. Grouping and ungrouping in protected workbook
    By tvwhome in forum Excel General
    Replies: 2
    Last Post: 03-30-2016, 03:56 PM
  3. [SOLVED] VBA code to allow grouping/ungrouping in protected excel worksheet
    By SherryAnneMay in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-22-2015, 04:58 AM
  4. Grouping/Ungrouping columns with the sheet protected?
    By Shishek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2013, 01:47 PM
  5. protected sheet to allow grouping/ungrouping
    By jw01 in forum Excel General
    Replies: 0
    Last Post: 01-09-2013, 11:26 AM
  6. Grouping/Ungrouping protected sheets with VBA
    By Stormdronk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-10-2011, 02:12 AM
  7. Enable group/ungrouping in a protected worksheet
    By friend11_6 in forum Excel General
    Replies: 0
    Last Post: 04-10-2011, 10:39 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