+ Reply to Thread
Results 1 to 6 of 6

VBA to auto-unlock a worksheet and then re-lock that sheet

  1. #1
    Registered User
    Join Date
    03-07-2015
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    11

    VBA to auto-unlock a worksheet and then re-lock that sheet

    Hi,
    I have an Excel 2013 sheet with a button that saves a sheet to a new workbook. It removes formulas and the button but if I password protect the original sheet it doesn't work. I want to have the original sheet locked so that nobody can accidentally delete any of the formulas. Is there a way to auto-unlock the sheet within that same macro and then re-lock it or is there another way to make it work while protected?
    My macro:
    Please Login or Register  to view this content.
    Thanks,
    Foos Master
    "Foosball is Therapy"

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: VBA to auto-unlock a worksheet and then re-lock that sheet

    Add a single line at top of the procedure..

    Please Login or Register  to view this content.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Registered User
    Join Date
    03-07-2015
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    11

    Re: VBA to auto-unlock a worksheet and then re-lock that sheet

    Thank you Very much DEC2HEX(3563),
    That works perfectly when the sheet is just protected without a password and if I must use it without a password it will be fine but...is there a way to do the same thing when the sheet is password protected?

    Thanks,
    Foos Master
    "Foosball is Therapy"

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: VBA to auto-unlock a worksheet and then re-lock that sheet

    In this case..

    you can unloak and re-lock..

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-07-2015
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    11

    Re: VBA to auto-unlock a worksheet and then re-lock that sheet

    Thank you Debraj Roy,
    That works to unlock the sheet and save the new sheet and lock it but it leaves the original sheet unlocked.

    Foos Master,
    "Foosball is Therapy"
    Last edited by Foos Master; 03-08-2015 at 02:26 AM.

  6. #6
    Registered User
    Join Date
    03-07-2015
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    11

    Re: VBA to auto-unlock a worksheet and then re-lock that sheet

    Partly Solved - See thread (http://www.excelforum.com/excel-prog...ml#post4010045) for other solution.

    Thanks to All for the help,
    Foos Master
    "Foosball is Therapy"

+ 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] How to lock and unlock worksheet using a password but inside worksheet change event
    By BeachRock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2014, 06:55 PM
  2. Lock Unlock Row
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2012, 03:57 PM
  3. worksheet lock / unlock problem
    By xes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2010, 11:14 AM
  4. i want to lock a tab in excel, and unlock in another sheet
    By john tempest in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-18-2005, 01:10 PM
  5. Replies: 2
    Last Post: 06-06-2005, 07: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