+ Reply to Thread
Results 1 to 2 of 2

VBA to Protect/unprotect only the formulas in each sheet of a workbook

  1. #1
    Forum Contributor
    Join Date
    01-14-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    109

    VBA to Protect/unprotect only the formulas in each sheet of a workbook

    Good day

    I have been researching this for 3 days now with no luck
    The below is the closest I got but it comes up with a debug for cel.Locked=true
    The error is:
    Run-time error '1004':
    Unable to set the locked property of the Range class

    Please Login or Register  to view this content.
    I need to password protect all formulas in all the sheets for a workbook, and then be able to unprotect it if changes needs to made by using the same password used to protect it
    Please help
    Last edited by WimpieOosthuizen; 03-22-2018 at 01:51 PM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: VBA to Protect/unprotect only the formulas in each sheet of a workbook

    Good morning WimpieOosthuizen

    Are you sure this is the code that fails?
    I can see nothing wrong with it, and I have just tested it and it works fine - it does exactly what you describe.

    HTH

    DominicB

+ 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. [SOLVED] Assign a button ton protect/unprotect sheet/workbook
    By waqar1239 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-26-2017, 08:00 PM
  2. Protect and Unprotect Workbook
    By colarguns in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2014, 07:57 AM
  3. [SOLVED] Unprotect/Protect Workbook Structure
    By Spear86 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-28-2014, 04:26 AM
  4. [SOLVED] Uploading data to a protect workbook; Unprotect workbook
    By pinstripe05 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-02-2013, 06:07 PM
  5. [SOLVED] VBA to protect & unprotect workbook
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2012, 07:39 AM
  6. [SOLVED] Protect & unprotect sheet and workbook
    By Ignesh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2012, 05:54 AM
  7. Protect and Unprotect Outside Workbook Automatically
    By mbrady1973 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2009, 10:52 AM

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