Archive of Mr Excel Message Board

Back to Controls in Excel archive index
Back to archive home

Changing Color of Text in Pull-Down Combo Boxes
Posted by Jeff Borek on June 20, 2000 6:35 AM
I want to "grey" certain items on a spreadsheet when they're not applicable.
This works fine for regular cells put I can't seem to change the color of the text in combo boxes, even if I change the color in the source cells.
Alternatively I could hide the rows with the combo boxes but some of the time the boxes don't always get hidden along with the rest of the row.
Any thoughts?

Re: Changing Color of Text in Pull-Down Combo Boxes
Posted by Ryan on June 20, 0100 9:23 AM
Jeff,
You could try reloading the combo box whenever something is changed and do code it so it skips the cells whose background color is gray (15). Here's an example:
If Range("A1").Interior.Color = 15 Then
cmbComboBox1.AddItem Range("A1").Value
End If
Loop this through your selection and you get the results that you want, I hope. I don't know of any way to change the color of the text inside of the combobox. Hope this helps
Ryan

Re: Changing Color of Text in Pull-Down Combo Boxes
Posted by Ivan Moala on June 20, 0100 8:20 PM
Jeff
The combobox avail via the Forms commandbar offers
very little in the way of the objects properties
and method eg color. Instead, try using the combobox avail from the Control toolbox. These are
activex controls and offer you more in the way of prgming. eg ComboBox1.BackColor = &HC0C0C0 changes
the background color to a shade of grey. You will have
to experiment to get what you want.
Ivan

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.