ComboBox BackColor change on value

KennyA

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

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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
 
Upvote 0
What values do you have in the combo?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top