Combo Box List Problems

  • Thread starter robert inman via OfficeKB.com
  • Start date
R

robert inman via OfficeKB.com

Is it possible,when selecting an item from a combo box list, which is
linked to another sheet,to have the font color or style change,depending
on the selection?
 
D

Dave Peterson

If you go into design mode, and right click on that combobox (from the control
toolbox toolbar), you'll see a property called .forecolor. There's also a .font
property you can access.

You can change it with something like:

Option Explicit
Private Sub ComboBox1_Change()

Dim myColor As Long
Dim myBold As Boolean

With Me.ComboBox1
Select Case .ListIndex
Case Is = 0: myColor = RGB(255, 0, 0)
myBold = False
Case Is = 1: myColor = RGB(0, 255, 0)
myBold = True
Case Is = 2: myColor = RGB(0, 0, 255)
myBold = True
Case Else
myColor = RGB(0, 0, 0)
myBold = False
End Select
.ForeColor = myColor
.Font.Bold = myBold
End With

End Sub

This does change the colors/font in the dropdown, too.
 
R

robert inman via OfficeKB.com

Dave I really appreciate your timely response. Only I don,t think I was
clear as to my problem. Is there any way to make the font style and/or
color change from item to item within the same list, in the same combo box.
If so please help. Again I thank you for your support.
 
D

Dave Peterson

Each option has a different font? Not within anything that's built into excel.

Sorry,
 
Top