ComboBox BackColor change on value

Fluff

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

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,425
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
76
I was experimenting/troubleshooting and added Yes/No and set a different ListFillRange
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,425
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
76
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
76
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
30,425
Office Version
365
Platform
Windows
Glad you got it sorted & thanks for the feedback
 

Forum statistics

Threads
1,078,253
Messages
5,339,103
Members
399,278
Latest member
randomNumberGenerator2211

Some videos you may like

This Week's Hot Topics

Top