+ Reply to Thread
Results 1 to 6 of 6

Allow group/ungroup AND format cells

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    3

    Allow group/ungroup AND format cells

    Hi,

    I have a number of worksheets that I wish to protect to content of but I also want users to be able to group/ungroup rows and columns as well as format the cells (i.e. change the number of decimal places a number is shown to).

    My current code does the following to lock each sheet

    ActiveSheet.Protect Password:="Password", DrawingObjects:=False, Contents:=True, Scenarios:= _
    True, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
    AllowFormattingRows:=True, AllowFiltering:=True


    However I don't seem to be able to add any form of EnableOutlining to this without it refusing to work!
    Is there any way to combine the two codes?

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Allow group/ungroup AND format cells

    Hi LHAT,

    welcome to the forum.
    I don't think Excel will allow decimal place changes after sheet protection.

    and for outlining, see below thread:-

    http://www.excelforum.com/excel-gene...ted-sheet.html



    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    04-12-2013
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Allow group/ungroup AND format cells

    Thanks DILIPandey for your reply! I have managed to allow the decimal place changes just from allowing the formatting of cells.

    Is there no way to combine the two pieces of code? (i.e. .EnableOutlining = True and Allowformattingcells:= True)

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Allow group/ungroup AND format cells

    "Outlining" is related to sheet level but "allow formatting cells" is related with sheet's protection option level.

    I would say try including both the codes - first the one from the link I given above followed by the one which you shown in post#1.

    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Registered User
    Join Date
    04-12-2013
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    3

    Red face Re: Allow group/ungroup AND format cells

    It works!

    Thanks for your help

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Allow group/ungroup AND format cells

    Great

    Please mark this thread as [SOLVED].. thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1