ComboBox BackColor change on value

KennyA

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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Fluff

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

KennyA

Board Regular
Joined
Jul 1, 2015
Messages
79
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
41,156
Office Version
365
Platform
Windows
What values do you have in the combo?
 

Fluff

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

Watch MrExcel Video

Forum statistics

Threads
1,099,933
Messages
5,471,604
Members
406,770
Latest member
livetolearn4life

This Week's Hot Topics

Top