Cell Protection

lukemedway

New Member
Joined
May 6, 2002
Messages
17
How can i lock a cell without the complication of adding user permissions as this wont be avaliable when i take my assignment into college?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Locking and Hiding cells is done through : right click on cell... format... protection tab.
By default all cells have lock checked. Uncheck if you do not want protected.

Now go to toolbar and select ... tools.. protection ... protect sheet
 
Upvote 0
Ah yes but there are certain cells that i want to remain active and editable! By protecting the worksheet, it means they cannot edit anything!

I only want to protect certain cells
 
Upvote 0
Ah feck, im not with it today i really aint!

*puts his head in a bucket of water and holds for 10 mins*
 
Upvote 0
Ok, new problem because the cells are protected my macro button doesnt work anymore!!! ARGH!!! (i hate spreadsheets)

The macro sorts the data in the cells but when i try to run it by clicking the button, i get a run-time error doh!!!!
 
Upvote 0
Private Sub CommandButton1_Click()
With Selection
Sheets("YOUR SHEET NAME HERE").Unprotect password:="YOUR PASSWORD"
YOUR CODE HERE
End With
Sheets("YOUR SHEET NAME HERE").Protect
password:="YOUR PASSWORD"
End Sub

James

_________________
This message was edited by James on 2002-05-08 11:30
 
Upvote 0
hmmm... now it says that it doesnt support this method and highlights this pices of code

Sheets("100m").UnProtect_password = "whatever"
This message was edited by lukemedway on 2002-05-08 11:30
 
Upvote 0
I usually don't bother with a password when protecting the sheets. After all we're just trying to prevent any changes by mistake.
Forget passwords for this stuff it's not worth the bother.

Other then that I totally agree with James suggestion...great solution
_________________

NOTE: Testing performed on Win2K utilizing Office 2000. Solutions may not work on other versions.
This message was edited by Nimrod on 2002-05-08 11:30
 
Upvote 0
So if the code is set out like that

Sheets("100m").UnProtect_password = "whatever"

do i just remove the password bit, so i looks like this?

Sheet(100m).Unprotect
This message was edited by lukemedway on 2002-05-08 11:38
 
Upvote 0

Forum statistics

Threads
1,214,573
Messages
6,120,318
Members
448,956
Latest member
Adamsxl

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