Results 1 to 5 of 5

Thread: Access the protected cell via Macro only

  1. #1

    Post Access the protected cell via Macro only



    Register for a FREE account, and/
    or Log in to avoid these ads!

    hi,

    I'm on the verge of completing my excel program. At the end I was looking to lock all the cells of the sheet except those which require user inputs. I'm running the program mostly via macros.
    The problem is that when I protect the sheet, i'm not able to run the macro. (error: the sheet is protected and therefore read-only)

    The following options were selected while protecting the sheet:
    1) Protect worksheet and content of locked cells (cannot uncheck this option)
    2) select unlocked cells

    Please help me to lock the cells and meanwhile execute the macro to change values in the locked cells.

    Thanks

  2. #2
    Just unprotect the sheet at the start of your macro and protect it again at the end.

  3. #3

    Post

    After completing the excel program, someone else is going to use it. So, i can't protect and unprotect it each time !

    I just want user to select unlocked cells and feed the input. The user should be restricted to change any value in the locked cell. Only background macro should calculate and change the value of the locked cell accordingly.

  4. #4
    You can, you do it in the code. I do it all the time.

    Code:
    Worksheets("name").Unprotect
    
    'your code
    
    Worksheets("name").Protect

  5. #5
    Thanks.... It works FINE !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •