+ Reply to Thread
Results 1 to 7 of 7

Need to protect sheet and disable "select Locked Cells" on pivot table

  1. #1
    Registered User
    Join Date
    01-22-2016
    Location
    Canada
    MS-Off Ver
    365
    Posts
    41

    Need to protect sheet and disable "select Locked Cells" on pivot table

    Hi,
    I have the following code that works fine except cells that I want "locked" are not locked. I can't find the "select unlocked cells" property as I'm a novice. How do you perform this with VBA code in Excel 2010? Cell A1 is the date being pulled from Worksheets(2) and I don't want the user to be able to change it when they run the pivot table report.

    Any help will be appreciated Thanks!


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to protect sheet and disable "select Locked Cells" on pivot table

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    01-22-2016
    Location
    Canada
    MS-Off Ver
    365
    Posts
    41

    Re: Need to protect sheet and disable "select Locked Cells" on pivot table

    I appreciate the help, but I get a compile error "Expected: named parameter" with the "AllowFiltering=True" being highlighted when trying that solution.

    When I have "Worksheets(3).Protect "pass" with one of "AllowFiltering = True" or "AllowUsingPivotTables = True", the worksheet gets locked like I want; however, the pivot table's filters are also locked and I don't want that.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to protect sheet and disable "select Locked Cells" on pivot table

    Missing two colons :

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-22-2016
    Location
    Canada
    MS-Off Ver
    365
    Posts
    41

    Re: Need to protect sheet and disable "select Locked Cells" on pivot table

    Awesome. Works now! Thanks.

    Out of curiosity, what do the colons signify (remember, I'm a novice)?

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to protect sheet and disable "select Locked Cells" on pivot table

    Quote Originally Posted by Murman01 View Post
    Awesome. Works now! Thanks.

    Out of curiosity, what do the colons signify (remember, I'm a novice)?
    The .Protect is a vba Method and AllowFiltering is an Argument for that method.

    argument:=value is the syntax used to set the value for a method's argument.

    This explains the difference between a Method (like .Protect) and a Property.

  7. #7
    Registered User
    Join Date
    01-22-2016
    Location
    Canada
    MS-Off Ver
    365
    Posts
    41

    Re: Need to protect sheet and disable "select Locked Cells" on pivot table

    Much appreciated!

+ 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. Disable "Select Multiple Items" in Pivot Table
    By bwolsky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2014, 06:19 PM
  2. Disable pop-up "The cells you are trying to select are protected"
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2013, 09:26 AM
  3. Disable "Select Multiple Items" in a Pivot Filter
    By FixandFoxi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2013, 06:19 AM
  4. Posted on another forum >> Disable "Select Sheet" Dialog box
    By gtorres in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2007, 02:43 PM
  5. [SOLVED] Changing data source in pivot table- "Back" button is disable
    By Ashok in forum Excel General
    Replies: 0
    Last Post: 11-08-2005, 10:10 AM
  6. Disable "Select Multiple Items" in Pivot Table
    By Pasha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-12-2005, 08:05 PM
  7. [SOLVED] how do you "select locked cells" w/o "select unlocked cells"?
    By princejohnpaulfin in forum Excel General
    Replies: 3
    Last Post: 07-15-2005, 11:05 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1