+ Reply to Thread
Results 1 to 6 of 6

How to make button work while sheet is locked

  1. #1
    Registered User
    Join Date
    08-08-2017
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    4

    How to make button work while sheet is locked

    Hello everyone,

    I am working on getting this worksheet done (that is supposed to be done today) and am currently using the following code with a button...

    Please Login or Register  to view this content.
    However, when I lock the sheet so that people inputting information cannot mess up the formulas, the button does not work. Any suggestions how I can alter that code or is there another code I could use to achieve the same result? Essentially I am trying to hide unused empty rows in a specific range.
    Last edited by aweyenberg; 08-31-2017 at 09:51 AM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: How to make button work while sheet is locked

    Thanks for fixing your post

    When you say "locking" the sheet I assume you mean protect it... Lets see if this works for you?

    Please Login or Register  to view this content.
    Last edited by Arkadi; 08-31-2017 at 10:03 AM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: How to make button work while sheet is locked

    goto your immediate window in the VB editor.
    Type -> ActiveSheet.Unprotect
    - Press Enter.
    - Type -> ActiveSheet.Protect UserInterfaceOnly:=True
    save file
    test button

  4. #4
    Registered User
    Join Date
    08-08-2017
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    4

    Re: How to make button work while sheet is locked

    Thank you, that does work. However, when I close the document and reopen it, that code does not stay in the document. Is there anyway to fix this? I need to be able to send this document to other employees to enter information and if that code goes away every time the sheet is closed, this will not work.

  5. #5
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: How to make button work while sheet is locked

    well, maybe put those statement in a worksheet open event (you are saving the file before exiting, correct?) so lets try this:

    put this in the "ThisWorkbook" code window (do you know how to do that?)
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: How to make button work while sheet is locked

    did this solve your problem?

+ 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. Button Macro to work on locked cells - URGENT
    By kvspawan19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2016, 02:47 AM
  2. is there a way to make my email button work when the sheet is protected?
    By blar in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-18-2012, 03:32 PM
  3. [SOLVED] How to make this code work even if the cells are locked and sheet is protected
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2012, 01:14 PM
  4. Locked Sheet - Macro's work - Internet Links Do Not
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-09-2009, 02:33 PM
  5. Hyperlinks:to work on a locked sheet.
    By melnikok in forum Excel General
    Replies: 0
    Last Post: 06-26-2007, 10:17 AM
  6. [SOLVED] not all cells are locked when protect is true for work sheet
    By Alexandre Brisebois (www.pointnetsolutions.com) in forum Excel General
    Replies: 3
    Last Post: 07-28-2005, 07:05 PM
  7. Replies: 1
    Last Post: 04-07-2005, 04:06 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