+ Reply to Thread
Results 1 to 4 of 4

VBA protect and unprotect

  1. #1
    Registered User
    Join Date
    02-15-2014
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    76

    VBA protect and unprotect

    I have some code that is running behind the scenes when an intersection change has been made. I want to protect this sheet as other people will be using it. I need to add to my existing code, something to unprotect every time the script runs and reprotect it once it is done. I'm unsure all the points I need to add it into.

    Here is my code thus far, I apologize it is rather lengthy:

    Please Login or Register  to view this content.
    That is the first half.

  2. #2
    Registered User
    Join Date
    02-15-2014
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    76

    Re: VBA protect and unprotect

    second half:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-15-2014
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    76

    Re: VBA protect and unprotect

    Final piece:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA protect and unprotect

    Hello NotSwank,

    For each of your procedures within your Code, with every action to be executed, and at the beginning of that instruction, you should use the Sheet #, or the Sheet Name,i.e.

    Sheet1.Unprotect "password" or

    Sheets("Whatever").Unprotect "password"

    and then, and at the end of any such instruction you would end with;

    Sheet1.Protect "password" or

    Sheets("Whatever").Protect "password".

    Regards
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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. Excel 2007 : protect and unprotect
    By runball in forum Excel General
    Replies: 0
    Last Post: 09-07-2009, 10:03 AM
  2. Protect and Unprotect using vba
    By mbrady1973 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-01-2009, 07:47 AM
  3. Protect UserInterface VS Protect/Unprotect
    By Desert Piranha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2006, 11:08 PM
  4. [SOLVED] unprotect and protect within a macro
    By Staalkop in forum Excel General
    Replies: 4
    Last Post: 10-27-2005, 04:05 PM
  5. [SOLVED] protect and unprotect
    By Andrew in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2005, 03:05 PM

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