ComboBox BackColor change on value

KennyA

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

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,425
Office Version
365
Platform
Windows
In what way doesn't it work?
 

KennyA

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

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,425
Office Version
365
Platform
Windows
What values do you have in the combo?
 

Fluff

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

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,425
Office Version
365
Platform
Windows

Forum statistics

Threads
1,078,252
Messages
5,339,097
Members
399,277
Latest member
Jyoti C

Some videos you may like

This Week's Hot Topics

Top