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

How can I make a non editable cell or Column based on the drop down selection in excel file Assume I am having 2 values in my drop down as Hourly and Salary. The other columns I have are Period Wages Rate of Pay and Hours.

If I select hourly I would like to enter data only in Hours Column, Like that if I select Salary I would like to enter data in Period Wages and Rate of Pay

Is is possible to do in excel if so can any one help me.

share|improve this question

You have a couple of options depending on how sensitive the cells are, and whether you're prepared to write some code.

if you actually want to (lock) the cells, you will need to write VBA code for this, specifically to respond to the Worksheet_Change event. One example of how to respond to a cell change is here. You'd need to write code to protect the appropriate cells based on the changed cell; a more comprehensive example of that is here.

A simpler alternative would be to use conditional formatting to gray out the cells based on a rule, to give the user a visual indication that they shouldn't be changed. This isn't secure, so if you have many users of the spreadsheet it probably isn't workable - but if you just have a couple of people using it, and you're trying to make their jobs easier, it may do what you want. There's plenty of examples of this online; one reasonable explanation is here.

share|improve this answer
Is it possible to do with out code? – Dorababu Apr 19 '12 at 16:16
@Dorababu - No, I don't think so, which is the reason I gave the alternate conditional formatting option. If it's something that's mission-critical, you could also commission someone to write an addon, or adapt the code I linked – Geoff Apr 19 '12 at 17:42

You must log in to answer this question.

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