ComboBox BackColor change on value

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,970
Office Version
365
Platform
Windows
How is it being populated?
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,970
Office Version
365
Platform
Windows
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.
 

KennyA

Board Regular
Joined
Jul 1, 2015
Messages
79
I was experimenting/troubleshooting and added Yes/No and set a different ListFillRange
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,970
Office Version
365
Platform
Windows
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
 

KennyA

Board Regular
Joined
Jul 1, 2015
Messages
79
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
 

KennyA

Board Regular
Joined
Jul 1, 2015
Messages
79
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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,970
Office Version
365
Platform
Windows
Glad you got it sorted & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,099,606
Messages
5,469,650
Members
406,664
Latest member
Bruister

This Week's Hot Topics

Top