+ Reply to Thread
Results 1 to 2 of 2

Combo box background colour

  1. #1
    John Davies
    Guest

    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. #2
    Mike Fogleman
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1