Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ColHeaders in a Listbox

41 views
Skip to first unread message

Thomas Schoch

unread,
May 25, 1998, 3:00:00 AM5/25/98
to

I have a listbox with 3 columns and the ColHeaders property set to
True. How can I now display some text in the colheaders? The listbox
is not bound but filled with some values when the userform is loaded.

Thomas

David Hager

unread,
May 25, 1998, 3:00:00 AM5/25/98
to

You need to use RowSource to fill the listbox and Excel will use the row
immediately
above that range as the column headers.

Regards,
David Hager

Thomas Schoch wrote in message <35693619...@msnews.microsoft.com>...

Thomas Ogilvy

unread,
May 25, 1998, 3:00:00 AM5/25/98
to

Thomas,
Here are a couple of places to start.

http://support.microsoft.com/support/kb/articles/q164/3/43.asp
Cannot Implement ListBox Control ColumnHeads Property

This says: You must use the ColumnHeads property with the ListFillRange,
Control Source, or Row Source properties to populate the headings. The
ColumnHeads property works with the Listfillrange property, which is
available in Microsoft Excel, or the Control Source and Row Source
properties, which are available in Microsoft Access. When you use the
Listfillrange property in Microsoft Excel, you can specify a range of values
that automatically populate a ListBox control. When you set the value of the
ColumnHeads properties to True, each column in the ListBox control contains
a heading for the relative column in the range.

The listfillrange is a property of the OLEObjects collection, so I think
this would only pertain if your listbox/combobox was embedded on a
worksheet. The listbox and combobox do have a Row Source property and how
to use it with ColumnHead is specified in the next article. I couldn't find
anything which implied that you could get a columnhead with an array, but
since you can't get Column Headings in Word or Powerpoint I would suggest
that it is not supported.

http://support.microsoft.com/support/kb/articles/q165/4/94.asp
XL97: Problems Setting Column Headings in ListBox Control

Gives some insight into how to set up column headings.

HTH,
Tom Ogilvy

Thomas Schoch

unread,
May 25, 1998, 3:00:00 AM5/25/98
to

So this means if I'm not using RowSource and fill the listbox
'manually' using .AddItem xxx I can't have column headers?

Thomas


On Mon, 25 May 1998 08:53:56 -0500, "David Hager"
<10407...@compuserve.com> wrote:

>You need to use RowSource to fill the listbox and Excel will use the row
>immediately
>above that range as the column headers.
>
>Regards,
>David Hager
>

0 new messages