Consulting

Results 1 to 4 of 4

Thread: Enable grouping and Ungrouping in Protected Sheet - VBA

  1. #1
    VBAX Regular
    Joined
    Jun 2013
    Posts
    14
    Location

    Enable grouping and Ungrouping in Protected Sheet - VBA

    Hello there,

    I have the following that protects my spreadsheet, but allows users to delete certain rows. I want the users to be able to group and ungroup certain columns that I have grouped already - so that it can be printed on A4. I
    tweaked my code and added "EnableOutlining:=true", after "UserInterfaceOnly:=True, AllowDeletingRows:=True", but it does not work.

    Thank you in advance,

    [VBA]Public Sub ProtectSheet(sWhichSheet)
    ' This Macro protects the Sheet
    If Sheets(sWhichSheet).ProtectContents = False Then
    Sheets(sWhichSheet).Protect Password:=sProtectionPassword, DrawingObjects:=True, Contents:=True, Scenarios:=True, UserInterfaceOnly:=True, AllowDeletingRows:= _
    True
    End If
    End Sub[/VBA]
    Last edited by Aussiebear; 06-28-2013 at 09:35 PM. Reason: Corrected the tags surrounding the code (Again)

  2. #2
    VBAX Mentor Teeroy's Avatar
    Joined
    Apr 2012
    Location
    Sydney, Australia
    Posts
    414
    Location
    Cross posted HERE.
    _________________________________________________________________________
    "In theory there is no difference between theory and practice. In practice there is." - Chuck Reid

    Any day you learn something new is a day not wasted.

  3. #3
    VBAX Regular
    Joined
    Jun 2013
    Posts
    14
    Location
    Teeroy, the Hyperlink in your response take me to mrExcel's question link that I posted.
    Do you have an answer to my question?

  4. #4
    VBAX Mentor Teeroy's Avatar
    Joined
    Apr 2012
    Location
    Sydney, Australia
    Posts
    414
    Location
    Jaspal, that was a message to other forum members. Multi-posting is frowned upon unless certain etiquette is used (see http://www.vbaexpress.com/forum/faq...._new_faq_item3). When cross posting it is polite to hyperlink to the original site so that any member who may work on the problem can check whether it has been solved elsewhere first.

    Your problem description is a little vague. Can you attach a workbook with some dummy data to help define the problem?
    _________________________________________________________________________
    "In theory there is no difference between theory and practice. In practice there is." - Chuck Reid

    Any day you learn something new is a day not wasted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •