How Do I Add Column Headers to a ComboBox?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I add text to the Header area of a 2-column ComboBox? I have the
ColumnHeads property set to True, which causes a blank, outlined header area
to display at the top of my drop-down list, but there's no property that I
can find that contains header text, nor can I find any mention of it in Help.
FYI, I'm loading the ComboBox from a 2D array using a statement like
ComboBoxAddress.Column() = AddressList.

Help says ComboBox data is stored in an array, with indexes starting at
(0,0). The first row in the array doesn't become the headers; if it did, my
header area would be populated with the first row of my data. I've tried
this statement: ComboBoxAddress.List(-1, 0) = "Used" (to populate the column
1 header with the text "Used") since "-1" is often used to signify a special
case and it would be logical since the header is one row before the first row
of data, which is row zero. That statement had no apparent effect.
 
Theoretically, the cell above your range that is used to populate the
comboBox is the ColumnHeader. I can't get it to work either.
 
I got it to work by listing my data in a column, pick any consecutive series,
C3:C10, with the proposed header in C2. In the Properties window, enter
c3:c10 in the Row Source box and set Column Heads to True. You can use any
range for your row source, If you want two columns then as an example set
c3:d10 as your row source and it will list these in your combo box as two
columns with eight rows and your header will be from C2 and D2 when you set
the column count property to 2.

The help instructions are not very clear, I had to play with it a while to
get it.
 
Just a hint: a quick google search for this group using the appropriate
terminology would have revealed the requirement and probably saved you some
time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top