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

In Excel 2010 is it possible to lock or disable editing of one or more cells based on the value set in another cell.

My idea was to have a drop down list in Cell 1A with, for example, locked and unlocked. Based on what was selected in the drop down list the remainder of row 1 is editable.

share|improve this question

This is quite possible if you use VBA. The basic idea would be to write an event handler for when the worksheet in question is modified.

In this event handler, you first need to check if the modified cell is within the range you want to lock. If it is, you should check the value of cell A1 to see if it's in a "locked state". If it is, you can then simply ignore the event.

See this reference site for some examples. You can also see this site for a list of events you may want to use.

share|improve this answer

You must log in to answer this question.

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