Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Header

Status
Not open for further replies.

CanonShooter

Structural
Oct 14, 2005
39
In VBA, a regular ole Combo Box control has a ColumnHeads property to display Column Headers (if you make it true).

Is there a way to put the text in the header? If you make this property true, it puts a blank row (no text) in there at the top.
 
Replies continue below

Recommended for you

If the listfill range is A2:A10 then A1 will be the column header.
 
Sorry, forgot to mention I wasn't "binding" the combo box data to anything in particular. It is more or less filled in insode the code, using AddItem.

So no Excel data to use. Does it have to get its data from "a table", to use the ColumnHeads property?
 
Thanks. That is about what I had figured. Of course, it stinks, but it figures ;-)
 
So, have the VBA create an invisible Excel spreadsheet to store headers. If this seems like a waste of resources for something as mundane as a header then use the sheet as an array variable as well (it comes pre dimensioned to 255 x 65536, three dimensional if you add extra worksheets), information stored on the sheet can be persistent from day to day.

The situation doesn't have to stink.

(Or change "invisible Excel spreadsheet" to "database" if you are more comfortable with databases)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor