Column heads for list box - how to do it

O

Oliver Kharraz

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
 
T

Tom Ogilvy

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).
 

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