listbox control in VBA

G

Guest

in a multi-column listbox I want to set column headers. There is a property ColumnHeads which I set to true, but everything I have tried ended up with the intended header text being displayed as the first data row, and the actual headers remained blank

Anyone who knows how to do this, or even better, has actually done something similar??

I use Excel version 10 (Excel 2002) for development, but the application must work in version 8 (Excel 97) or later version

From the Microsoft Excel Visual Basic Referenc

"ColumnHeads Propert


Displays a single row of column headings for list boxes, combo boxes, and objects that accept column headings

Synta

object.ColumnHeads [= Boolean

The ColumnHeads property syntax has these parts

Part Description
object Required. A valid object.
Boolean Optional. Specifies whether the column headings are displayed.

Setting

The settings for Boolean are

Value Description
True Display column headings.
False Do not display column headings (default).

Headings in combo boxes appear only when the list drops down

Remark

When the system uses the first row of data items as column headings, they can't be selected"
 
T

Tom Ogilvy

The column heads are the row above your rowsource or listfill range
property. So if your data is in A1:C20 for example, with column headings in
Row 1, you would set your rowsource or listfill range property to A2:C20 and
set ColumnHeads to true.

--
Regards,
Tom Ogilvy

Ard said:
in a multi-column listbox I want to set column headers. There is a
property ColumnHeads which I set to true, but everything I have tried ended
up with the intended header text being displayed as the first data row, and
the actual headers remained blank.
Anyone who knows how to do this, or even better, has actually done something similar???

I use Excel version 10 (Excel 2002) for development, but the application
must work in version 8 (Excel 97) or later versions
From the Microsoft Excel Visual Basic Reference

"ColumnHeads Property


Displays a single row of column headings for list boxes, combo boxes, and
objects that accept column headings.
Syntax

object.ColumnHeads [= Boolean]

The ColumnHeads property syntax has these parts:

Part Description
object Required. A valid object.
Boolean Optional. Specifies whether the column headings are displayed.


Settings

The settings for Boolean are:

Value Description
True Display column headings.
False Do not display column headings (default).


Headings in combo boxes appear only when the list drops down.

Remarks

When the system uses the first row of data items as column headings, they
can't be selected"
 

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

Top