Locking specific cells in a workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,
Somehow the way I know how to lock specific cells in a workbook isn't
working. can you remind me how to do it please?
Also, do you have to adjust the protection for each sheet individually? Or
is there a way to do the whole work book at once?
Thanks!
 
If you haven't changed anything, then each cell on the worksheet is locked.

You can select the cells you want unlocked and then
format|cells|protection tab|uncheck locked

But then you have to protect the worksheet.
Tools|Protection|Protect workbook
(Give it a memorable password if you want)

And you have to protect each sheet individually--or use a macro:

Option Explicit
Sub ProtectAllSheets()
dim wks as worksheet
dim myPWD as string
myPWD = "topSeCrEt"
for each wks in thisworkbook.worksheets
wks.protect password:=myPwd
next wks
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Sarah said:
Somehow the way I know how to lock specific cells in a workbook isn't
working. can you remind me how to do it please?

The process would be:
1. Unlock all cells in the sheet first

Select the entire sheet,
Click Format > Cells > Protection tab
Uncheck "Locked" > OK
(As Dave pointed out, all cells are "locked" by default)

2. Lock those specific cells/ranges

Hold down CTRL key and multiselect all the specific cells/ranges
Click Format > Cells > Protection tab
Check "Locked" > OK

3. Apply sheet protection

Click Tools > Protection > Protect Sheet > Password? > OK


---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top