Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.