Column heads for list box - how to do it

  • Thread starter Thread starter Oliver Kharraz
  • Start date Start date
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
 
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).
 
Back
Top