View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Combo box background colour

Try this in the combobox_change event code:

Private Sub ComboBox1_Change()
If Range("A2").Value = 1 Then Me.ComboBox1.BackColor = RGB(255, 0, 0)
If Range("A2").Value = 2 Then Me.ComboBox1.BackColor = RGB(0, 255, 0)
If Range("A2").Value = 3 Then Me.ComboBox1.BackColor = RGB(0, 0, 255)
End Sub

Mike F
"John Davies" wrote in message
...
I have a combo box and it is linked to a cell a2.
When I select a value from the combo box drop down list this obviously
changes the value in cell A2. Is it possible to have the background of
the
como box automatically change colour depending on the value of cell a2?
e.g. Cell A2 = 1, combo box background = red
Cell A2 = 2, combo box background = green
Cell A2 = 3, combo box background = blue
Thanks for any help