View Single Post
  #21   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default How do you format data that is part of a drop down menu?

You can change the color after the item has been selected.

Either through CF or event code.

In 2007 you can have 64 CF rules in a cell.

In 2003 only 3 rules for a cell.

Event code could look like this. Assumes A1 is DV dropdown.

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A1")
If Intersect(Target, r) Is Nothing Then
Exit Sub
End If
vals = Array("C", "D", "G", "H", "K", "L", "O", "S", "C", "X") 'your items
nums = Array(8, 9, 6, 3, 7, 4, 20, 10, 8, 15)
With Target
icolor = 0
For i = LBound(vals) To UBound(vals)
If UCase(r.Value) = vals(i) Then
icolor = nums(i)
End If
Next
If icolor 0 Then
.Font.ColorIndex = icolor
End If
End With
End Sub

If you have many items in your list you may want to employ a lookup table
for vals and nums arrays.


Gord

On Thu, 10 Dec 2009 12:08:01 -0800, Kirk
wrote:

Can you change the text color in a DV Dropdown list? I would like to select
text from the Data Validation dropdown and have the resulting value selected
in the cell colored. Can this be done using Conditional Formatting somehow?
Perhaps a Macro to detect the cell contents change and change the color of
the text depending on the value? Help! :)

"Gord Dibben" wrote:

You cannot change the font size in a DV dropdown.

There are workarounds.

See Debra Dalgleish's site for these.

http://www.contextures.on.ca/xlDataVal08.html#Larger


Gord Dibben MS Excel MVP

On Sat, 16 Sep 2006 07:30:02 -0700, Jester
wrote:

If you use a drop down menu list with data validation, the menu is so small
you can't read it. How do you apply normal formatting to improve the
situation (font size, bold, etc.)