allow macro to get behind cell protection

Billm

Board Regular
Joined
Mar 19, 2002
Messages
88
My spreadsheet uses Protect Sheet and Protect Workbook. I have protected the range A1.. A3 in my spreadsheet to stop users from messing things up. Instead they have a macro which they can run which will change the formulas in those cells. But as those cells are protected .. the macro errors out when run.

Is there VB code I can put into the start of the macro that will un-protect those cells, then as it finishes .. puts the protection back on.

Thanks Bill
 
For protecting you could use:

ActiveWorkbook.Protect Structure:=True, Windows:=True

I may be too old for this!!! And I'm too tired to go further! :)

_________________
- old, slow, and confused
... but at least I'm inconsistent -
This message was edited by shades on 2002-04-24 07:10
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,215,053
Messages
6,122,882
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top