Can Combo Boxes Be Formatted?

J

J Tulk

Is there any way to format the contents of a combo box? I
am using EXCEL 97. The format of the list has no effect
on the format in the combo box. The combo box doesn't
seem to have any properties except size.
 
C

Cesar Zapata

Hi,

YOu can use the format function for example lets say your list contains
dates then use the format in the change event for the combobox

Private Sub ComboBox1_Change()

ComboBox1.Value = Format(ComboBox1.Value, "mm/dd/yy")

End Sub





Cesar Zapata
 
P

Patrick Molloy

Correct . You need to format any text, dates or numbers before you add them
to the combo or list box
 
B

Bob Phillips

My experience is that a combobox picks up the original data format if you
use the fill range attribute of the combo.

If you are adding the items from the worksheet one at a time, that needs
formatting.

Which are you doing, and what is the format being lost?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
J

J Tulk

The formatting I'm trying to do is to make the contents of
the box have a higher point size (font size = 18 to 30)
and to be bold. I tried variations on the code you show
below but I'm not good enough to figure out thewording
that is needed.
 
B

Bob Phillips

You can't do this with a forms combobox, you can with a control toolbox
combobox which has a font property.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
J

J Tulk

I had a list of three names in a worksheet
called "Title". I added a combo box that I copied from
another sheet I created about two years ago. I brought up
the "Format Control" by right clicking the combo box. In
the "Format Control" I click on the "Control" tab. In the
control tab I entered the "Input Range", "Cell Link"
and "Drop Down Lines". The names in the list were
formated to Arial, bold and 12 point. The names come up
in the box at what looks like Arial, regular and 9 point.
 
B

Bob Phillips

I figured the gist of this out from your other reply. As I said, if you want
to change the font, you need control toolbox combos.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top