Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

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

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

    Default Re: ComboBox BackColor change on value

    How is it being populated?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  2. #12
    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

    From the sheet. I used ListFillRange Q5:Q8. LinkedCell is L5

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

    Default Re: ComboBox BackColor change on value

    In that case I don't see how the back colour would change if you used
    Code:
    With ComboBox11
        Select Case .Value
            Case "Yes"
            .BackColor = &HFF00&
            Case "No"
            .BackColor = &HFF&
            Case Else
            .BackColor = &HFF00&
        End Select
    End With
    if Yes and No are not one of the values 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

  4. #14
    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

    I was experimenting/troubleshooting and added Yes/No and set a different ListFillRange

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

    Default Re: ComboBox BackColor change on value

    OK, because it's case sensitive, try
    Code:
        With Me.ComboBox1
            Select Case LCase(.Value)
                Case "terminal box"
                    .BackColor = &HFF00&
                Case "none"
                    .BackColor = &HFF&
                Case Else
                    .BackColor = &H80000005
            End Select
        End With
    - 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. #16
    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

    I tried that code as well and still the BackColor did not change.
    I am starting to wonder if this particular code set only works with YES or NO values

  7. #17
    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

    I got it to work. I had to run the code on the sheet in VBA. Originally I was running it from a Module. Thank you for all your help!!!

    With ComboBox11
    Select Case .Value
    'Case "YES"
    '.BackColor = &HFF00&
    Case "NONE"
    .BackColor = &HFF&
    Case Else
    .BackColor = &HFF00&
    End Select
    End With

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

    Default Re: ComboBox BackColor change on value

    Glad you got it sorted & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

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
  •