Drop down boxes and conditional formating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to have the ability to have a dropdown box with a list (I have this already) and have the value in the list that is selected change the color of a group of cells. Basically value A will change the color of the affected cell to blue, value B to green, etc..

I can get the color of the list cell to change, but not others.
 
David

Use Conditional Formatting on the cell where the dropdown box is. It is
found under the Format menu. If you need help, post back.

Andy.

David Hastings said:
I need to have the ability to have a dropdown box with a list (I have this
already) and have the value in the list that is selected change the color of
a group of cells. Basically value A will change the color of the affected
cell to blue, value B to green, etc...
 
I can do the conditional formating, but it only changes the color in the cell where the drop down box is. I need it to change the color of other cells as well.

Davi

----- Andy B wrote: ----

Davi

Use Conditional Formatting on the cell where the dropdown box is. It i
found under the Format menu. If you need help, post back

Andy

David Hastings said:
I need to have the ability to have a dropdown box with a list (I have thi
already) and have the value in the list that is selected change the color o
a group of cells. Basically value A will change the color of the affecte
cell to blue, value B to green, etc..
 
Hi
if your dropdown is in cell A1 and you want to change cells A1:D1 based
on the value in A1 try
- select cells A1:D1
- goto the conditional format dialog and enter the formula
=$A1 = "some value"
- choose your format
 
One other issue. I have six conditions and would like to use 6 color changes, but I can only set 3 conditional formatting conditions. Is there another way to accomplish the same goal

David
 
Hi David
conditional format only accepts 3 conditions though you have a fourth
if you include the default format.

If you only want to apply different FONT colors based on NUMBERS, you
can define up to 6 different styles. See:
http://www.mcgimpsey.com/excel/conditional6.html
for instructions how to do it

For everything else you'll need VBA code (e.g. process the
worksheet_change event and apply your format based on the cell values).
The following will color the entry in cell A1:A100 based on its value:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1:A100")) Is Nothing Then Exit Sub
On Error GoTo CleanUp:
With Target
Select Case .Value
Case "Red": .Interior.ColorIndex = 3
Case "Blue": .Interior.ColorIndex = 10
'etc.
End Select
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Back
Top