Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Combo box background colour

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
excel and background colour anonymous Setting up and Configuration of Excel 1 April 5th 05 04:58 PM
excel and no background colour anonymous Excel Discussion (Misc queries) 1 April 5th 05 12:32 AM
Background colour using VB Tom Ogilvy Excel Programming 2 September 15th 04 08:58 PM
Background colour using VB No Name Excel Programming 0 September 15th 04 02:51 PM


All times are GMT +1. The time now is 10:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"