ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Combo Box List Problems (https://www.excelbanter.com/excel-discussion-misc-queries/24729-combo-box-list-problems.html)

robert inman via OfficeKB.com

Combo Box List Problems
 
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?

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.


"robert inman via OfficeKB.com" wrote:

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?


--

Dave Peterson

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.

--
Message posted via http://www.officekb.com

Dave Peterson

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

Sorry,

"robert inman via OfficeKB.com" wrote:

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.

--
Message posted via http://www.officekb.com


--

Dave Peterson


All times are GMT +1. The time now is 02:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com