+ Reply to Thread
Results 1 to 4 of 4

Clear an Unprotected Cell using a "Reset" Button on a Protected Spreadsheet

  1. #1
    Registered User
    Join Date
    08-20-2018
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    2

    Clear an Unprotected Cell using a "Reset" Button on a Protected Spreadsheet

    I am very new to this and need a little help.

    I have used the following code to clear a Cell using a Command Button.

    Private Sub RiskCalculatorReset_Click()
    Sheets("01 - Risk Calculator").Range("G11").Value = ""
    End Sub

    This works, but when I protected the sheet, my unprotected cell does not clear anymore.

    Is there any code that will allow me to overcome this?

  2. #2
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Clear an Unprotected Cell using a "Reset" Button on a Protected Spreadsheet

    Hello Ah50,

    The only way around this is to unprotect your worksheet whilst you are working on it. Hence, your code amended as follows will do this:-


    Please Login or Register  to view this content.
    Then, to protect the sheet again once you are done with it, place the following code in the Worksheet module:-

    Please Login or Register  to view this content.
    Once you leave this sheet, the sheet will be once again protected. To implement this code:-

    - Right click on the sheet tab and select "View Code" from the menu that appears.
    - Paste the above code in the big white field that then appears.
    - Save your workbook.

    Test it in a copy of your workbook first.

    I hope that this helps.

    Cheerio,
    vcoolio.
    Last edited by vcoolio; 08-21-2018 at 12:06 AM. Reason: Typos.

  3. #3
    Registered User
    Join Date
    08-20-2018
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    2

    Re: Clear an Unprotected Cell using a "Reset" Button on a Protected Spreadsheet

    Thank you very much for your help.

  4. #4
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Clear an Unprotected Cell using a "Reset" Button on a Protected Spreadsheet

    You're welcome Ah50.

    Cheerio,
    vcoolio.

+ 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. "clear data" and reset page length/file size
    By ahalliwell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2017, 06:28 AM
  2. "clear data" and reset page length/file size
    By ahalliwell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2017, 12:34 PM
  3. Replies: 1
    Last Post: 10-23-2013, 05:20 PM
  4. [SOLVED] Keyboard command in excel vba for the "reset" square button
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2012, 09:07 AM
  5. Replies: 3
    Last Post: 09-26-2012, 06:17 AM
  6. Create a clear/reset "button"?
    By splenguin in forum Excel General
    Replies: 10
    Last Post: 09-03-2009, 06:12 PM
  7. [SOLVED] Clear"Reset" data input.
    By Frick in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-10-2006, 07:45 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