+ Reply to Thread
Results 1 to 7 of 7

Grouping/Ungrouping protected sheets with VBA

  1. #1
    Registered User
    Join Date
    04-02-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    27

    Grouping/Ungrouping protected sheets with VBA

    Hi all

    Hope someone can help. I am working on a sheet with VBA but cant get it to work. This is my first trie with VBA.

    I need to be able to group/ungroup rows in a sheet when it is protected. All sheets needs to have the code. My password will be lets say "Stormdronk"

    Hope this is clear, thanks so much for the help!!!
    Attached Files Attached Files
    Last edited by Stormdronk; 08-04-2011 at 05:23 AM.

  2. #2
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Smile Re: Grouping/Ungrouping protected sheets with VBA

    You probably want this in the WorkBook object (ThisWorkbook in your VBE).

    Please Login or Register  to view this content.
    The workbook open event will only run from the workbook object (ThisWorkbook). Good luck!
    -Greg If this is helpful, pls click Star icon in lower left corner

  3. #3
    Registered User
    Join Date
    04-02-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Grouping/Ungrouping protected sheets with VBA

    Hi Greg,

    Thanks for the code, unfortunately I cant get it to work, I attached my file with the code in.

    If posible, please can you see if you can correct it.

    Thanks in advance!!!

  4. #4
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Smile Re: Grouping/Ungrouping protected sheets with VBA

    Here it is...I didn't add any passwords. I only used the existing code you had written. Good luck!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-02-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Grouping/Ungrouping protected sheets with VBA

    Thanks so much, it workes grate!!! Apreciate the help!

  6. #6
    Registered User
    Join Date
    07-30-2009
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Grouping/Ungrouping protected sheets with VBA

    I've been trying to use the same solution but I cannot make it work.
    Can you also please help me make it work?
    I attached my sample spreadsheet.
    Thanks.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-30-2009
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Grouping/Ungrouping protected sheets with VBA

    I did not immediately noticed the important note:
    The workbook open event will only run from the workbook object (ThisWorkbook).

    My spreadsheet is now working fine.
    Thanks.

+ 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