Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

By LOCKING the cells, and switching protection on will make whole file read-only .. But I want to make only few/selected cells as read-only .. that means, those cells cannot be edited anymore ..

Is there any facility as such pre-defined in MS-office .. Please let me know if you aware of this feature ..

share|improve this question
up vote 1 down vote accepted

A couple different solutions could be used...

  1. With the sheet not protected, use Format - Cells - Protection tab. Uncheck "Locked" for those cells to be changeable. Now protect the sheet with Tools - Protection - Protect sheet.

  2. If the first solution doesn't work, you could always use a macro to automatically kick people out of the cells you don't want them in. You could use a macro similar to the one below. Based on your selection, if it falls between the Range(A1:A4) it'll automatically kick you out of those cells and dump you into cell B1. I suppose you could use inidividual cells instead of a range.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  If Not Intersect(Selection, Range("A1:A4")) Is Nothing Then
  End If
End Sub
share|improve this answer
ohk .. but where to copy paste this macro .. ? may sound simple to you but I don't know basics of it .. Please help :-| – InfantPro'Aravind' Feb 16 '10 at 5:18
Click the Office button, choose Excel Options, check the "Show developer tab in Ribbon" checkbox and click OK. Click on the Developer tab at the top, click on Visual Basic. On the left hand side, double-click "This Workbook". Paste the code into the right hand side, save and close. Then, test the macro. – Mark Feb 16 '10 at 12:49
Thank you so much .. Its working .. :-) I am too happy to learn this thing today .. :-) – InfantPro'Aravind' Feb 17 '10 at 4:56
This won't work correctly if you ever insert rows or columns. – guitarthrower Mar 12 '10 at 17:54
@guitarthrower, yup I am aware of it. – InfantPro'Aravind' Mar 18 '10 at 11:54

You don't have to lock the whole sheet. You can just lock a few cells then protect the sheet, then the rest of the cells can be edited still.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .