Excel Protection

CraigWolfenden

New Member
Joined
Sep 9, 2010
Messages
39
Hello There,

I have designed a spreadsheet which is nearly ready to be deployed nationally.

However I wish to protect the code etc in the spreadsheet but I have a few problems I need to get around.

The spreadsheet is designed so a user places a number in cell A5, in turn this number is referenced to a Master Sheet, and the remainder of this row is completed.

The user then moves to B5 and repeats the action.

As the cells contain varying text depending on the number entered I have created an Excel Macro button to automatically format the rows to the correct size using Format -> Row -> Auto-Fit.

My problem is if I enable Protection (Tools -> Protection -> Protect Sheet) the auto-height will not work forcing me to leave the code open for anyone to modify.

Can anyone help me with this problem.

Thanks in advance.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try like this

Code:
ActiveSheet.Unprotect password:="pw"
'
'your code
'
ActiveSheet.Protect password:="pw"
 
Upvote 0
Hello and thank you for your reply.

Are you suggesting I add a line to the code of the macro to unprotect the spreadsheet, then run auto format then protect it again?

Once again thank you for your reply.
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,941
Members
449,480
Latest member
yesitisasport

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