Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: ComboBox BackColor change on value
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jul 2015
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default ComboBox BackColor change on value

    I have a ComboBox that I am trying to get the BackColor to change based on a selection.
    There are 11 ComboBoxes on the sheet. After I have gone through all the boxes and made the selections
    I hit the finish button which runs the VBA code.

    Using ActiveX ComboBox. This is the code I tried using. I am obviously doing something wrong.
    I want TERMINAL BOX to be green and NONE to be red

    With ComboBox11
    Select Case .Value
    Case "TERMINAL BOX"
    .BackColor = &HFF00&
    Case "NONE"
    .BackColor = &HFF&
    Case Else
    .BackColor = &HFF00&
    End Select
    End With

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,151
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: ComboBox BackColor change on value

    In what way doesn't it work?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular
    Join Date
    Jul 2015
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ComboBox BackColor change on value

    Quote Originally Posted by Fluff View Post
    In what way doesn't it work?
    The back color doesn't not change

  4. #4
    Board Regular
    Join Date
    Jul 2015
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ComboBox BackColor change on value

    Let me add this as well. If I use YES in the code replacing TERMINAL BOX and NO for NONE the back color does change

  5. #5
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,151
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: ComboBox BackColor change on value

    What values do you have in the combo?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  6. #6
    Board Regular
    Join Date
    Jul 2015
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ComboBox BackColor change on value

    None
    terminal box
    lcp
    lcp-aso

  7. #7
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,151
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: ComboBox BackColor change on value

    The only reason I can think it would work if you use Yes & No is if the combo has multiple columns, some of which are hidden.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  8. #8
    Board Regular
    Join Date
    Jul 2015
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ComboBox BackColor change on value

    Thanks
    I will look into that

  9. #9
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,151
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: ComboBox BackColor change on value

    OK.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  10. #10
    Board Regular
    Join Date
    Jul 2015
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ComboBox BackColor change on value

    That was not it. The ComboBox has one bound column

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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