ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   cell protection (https://www.excelbanter.com/excel-discussion-misc-queries/194786-cell-protection.html)

ckane

cell protection
 
On a form, there are certain cells that I have locked so that they can't be
changed. Most of the cells are unlocked. Also on the sheet I have several
buttons that I have assigned macros to. When I protect the sheet and try to
run the macros I get an error message. What do I need to do to protect the
sheet and get the macros to run? Thanks.

Jim Rech

cell protection
 
A button should be clickable to run a macro even on a protected sheet. But
if the macro does something that requires an unprotected sheet the macro
might have to include the unprotecting and reprotecting of the sheet.

A possible alternative is to protect the sheet using the UserInterfaceOnly
perimeter of the of the worksheet Protect method (see Help). For most
actions the macro would not then have to do the unprotect/reprotect.

--
Jim
"ckane" wrote in message
...
| On a form, there are certain cells that I have locked so that they can't
be
| changed. Most of the cells are unlocked. Also on the sheet I have
several
| buttons that I have assigned macros to. When I protect the sheet and try
to
| run the macros I get an error message. What do I need to do to protect
the
| sheet and get the macros to run? Thanks.




All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com