Macro Question

  • Thread starter Thread starter DangerMouse114
  • Start date Start date
D

DangerMouse114

I need to protect my sheet from users making changes to certain cell
but I am encountering a problem with my macro buttons.

The button makes changes to cells that I have locked and protected fro
users. When i protect the sheet the button cannot make the changes an
gives an error.

Is there a way to allow the macro to do its work on locked cells whil
still protecting the cell from user changes
 
Your macro will need to unprotect the sheet, make the changes then
re-protect the sheet.

ActiveSheet.Unprotect Password:="password"

ActiveSheet.Protect Password:="password"

Set the command button, TakeFocusOnClcik to False

Cheers
Nigel
 
The code assigned to the buttons need to unprotect the
target cells, change their values and then re-protect them


Patrick Molloy
Microsoft Excel MVP
 
Thanks Nigel! Worked like a charm!



*Your macro will need to unprotect the sheet, make the changes then
re-protect the sheet.

ActiveSheet.Unprotect Password:="password"

ActiveSheet.Protect Password:="password"

Set the command button, TakeFocusOnClcik to False

Cheers
Nigel

"DangerMouse114 >" <<[email protected]
wrote in
message news:D[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top