ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Column heads for list box - how to do it (https://www.excelbanter.com/excel-programming/282839-column-heads-list-box-how-do.html)

Oliver Kharraz

Column heads for list box - how to do it
 
Hi,

does anyone have sample code that

a) uses a ListBox with several columns
b) Adds items to this listbox?

Ideally, I would even like to have the different lines to have different
font colors - is this possible at all in VBA?

Thanks so much for your help,

Oliver





Tom Ogilvy

Column heads for list box - how to do it
 
Different colors. No.

You can set the columnheads and columncount property in the properties of
the listbox - no code needed.

You have to use the rowsource (userform) or listfillrange (worksheet)
property of the listbox to populate it if you want to use column heads. If
you set columnheads to true, then the data in the row above your
rowsource/listfillrange is used to populate the column heads (so don't
include your header row in the rowsource or listfillrange address).

--
Regards,
Tom Ogilvy

"Oliver Kharraz" wrote in message
...
Hi,

does anyone have sample code that

a) uses a ListBox with several columns
b) Adds items to this listbox?

Ideally, I would even like to have the different lines to have different
font colors - is this possible at all in VBA?

Thanks so much for your help,

Oliver








All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com