0
votes

I have an excel sheet with 100s of rows. I want to be able to lock a particular range from being edited while the others can be left editable. And protect the locked range with a password.

Please help

Activesheet.protect locks the whole sheet. I want it only for a few cells.

1
If you googled this you would probably find 10 billion results in 0.001 seconds!SJR
You first have to format all cells as unprotected and then you format the particular cells as protected (Press Ctrl-1 to get the format dialog) and then you can protect the sheet support.office.com/en-us/article/…Storax
I tried googling for hours. All I could find was one which would lock whole sheet. Please give some code just for rangeVadiraj Katti
Not being funny, but what exactly did you search for? Even Excel's built in help would answer this for you. Unless there's something you're not telling us, you don't need VBA for this.SJR

1 Answers

0
votes

F1 opens the Excel help. If you do a search in there, or on google, the top result would be the following link: https://support.office.com/en-us/article/Lock-or-unlock-specific-areas-of-a-protected-worksheet-75481b72-db8a-4267-8c43-042a5f2cd93a

This should help you out.

In short:

  1. Right click on the cells you want editable

  2. Format Cells...

  3. Tab Protection

  4. For cells that people should be able to Edit: Uncheck "Locked". For cells that people should NOT be able to edit, leave the check for "Locked".

  5. Click OK.

Next, go to the Review tab in the Ribbon and protect your sheet as normal.