dropdownlist selection changed - grey out cells

  • Thread starter Thread starter Jagdip Singh Ajimal
  • Start date Start date
J

Jagdip Singh Ajimal

I have a cell where I have put data validation in. The validation is a
selection from a list.
I want to gery out a cell when a certain value is selected in the
list. Can I do this?

Do I have to use a combo box and a macro instead?
 
You can use conditional formatting on the other cell.

For example, to grey out cell E3, if "No" is selected in cell D3:

Select cell E3
Choose Format>Conditional Formatting
From the first dropdown, choose Formula Is
In the formula box, type: =D3="No"
Click the Format button
 
Brill. Thank you.


Debra Dalgleish said:
You can use conditional formatting on the other cell.

For example, to grey out cell E3, if "No" is selected in cell D3:

Select cell E3
Choose Format>Conditional Formatting
From the first dropdown, choose Formula Is
In the formula box, type: =D3="No"
Click the Format button
 
Is there any way I can also disable the geryed out cell as well (when
the condition is false).
 
You could use data validation to disable the greyed out cell:

Select cell E3
Choose Data>Validation
From the Allow dropdown, choose Custom
In the Formula box, type: =D3<>"No"
Click OK
 
Ahh, thank you. You should write a book or something ;-)

But, just one last problem. When a certain value is selected in the
ddl, I can:
- grey out the cell.
- disable the cell.

But, when I select "no" in the ddl, I also want to remove the text in
the cell. Is there a way I can do this aswell?

Again, thank you for your help.
 
You could do that with programming:

Right-click on the sheet tab
Choose View Code
Where the cursor is flashing, paste the following code:

'==============================
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$3" Then
If UCase(Target.Value) = "NO" Then
Range("E3").Value = ""
End If
End If
End Sub
'============================

Ahh, thank you. You should write a book or something ;-)

But, just one last problem. When a certain value is selected in the
ddl, I can:
- grey out the cell.
- disable the cell.

But, when I select "no" in the ddl, I also want to remove the text in
the cell. Is there a way I can do this aswell?

Again, thank you for your help.


Debra said:
You could use data validation to disable the greyed out cell:

Select cell E3
Choose Data>Validation
From the Allow dropdown, choose Custom
In the Formula box, type: =D3<>"No"
Click OK

(when
is a
 
Back
Top