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
 

Some videos you may like

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
38,706
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
38,706
Office Version
365
Platform
Windows
What values do you have in the combo?
 

Fluff

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

Watch MrExcel Video

Forum statistics

Threads
1,095,647
Messages
5,445,746
Members
405,356
Latest member
Pints

This Week's Hot Topics

Top