protecting the entire workbook except a range of cells

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
831
Office Version
  1. 365
Platform
  1. Windows
Can someone tell me how to modify my code? I was locking out the entire worksheet and now someone needs access to a specific range of cells.
This is what I am currently using....Thanks

Code:
Cells.Select
    ActiveSheet.Protect Password:="1288", DrawingObjects:=True, Contents:=True, Scenarios:=True
    ActiveSheet.EnableSelection = xlNoSelection
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Best and easy way to do this is. Change the property of this range to unlock and then protect sheet ----then other person can only make changes on the permitted cells or range of cells.
 
Upvote 0
Simply record a macro to select the range of cells then use Ctrl + 1 to get to fromat cells, select the Protection Tabe and deselect the Lock then close the format and then use the Review Tab and select Protect Sheet then add yoru password confirm the password then select another cell and stop recording this is what you end up with.

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Macro1()<br><SPAN style="color:#007F00">'</SPAN><br><SPAN style="color:#007F00">' Macro1 Macro</SPAN><br><SPAN style="color:#007F00">'</SPAN><br><br><SPAN style="color:#007F00">'</SPAN><br>    Range("D4:I14").Select<br>    Selection.Locked = <SPAN style="color:#00007F">False</SPAN><br>    Selection.FormulaHidden = <SPAN style="color:#00007F">False</SPAN><br>    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True<br>    Range("A1").Select<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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