How to add data to ColumnHeads of Listbox

L

lehainam

Dear all,

I created a listbox in Excel and load data from Access file but I don't
know how to add data to columnheads of that listbox.

Could any one can help me.

Thanks a lot.

Nam
 
G

Guest

I assume this is a Controls listbox, not Forms (since I don't think you can
set column headers in Forms listbox). Do you put your Access data onto your
worksheet first, or are you creating your listbox strictly from code? If you
put it into a range on your sheet, the Controls listbox should automatically
choose the cells above your .ListFillRange as the column headers if you
specify .ColumnHeads=True. But I don't see any way other than this to
specify the column headers (I know in an Access form you can use the
RowSourceType and RowSource to specify headings).

A trick I have used at times is to place textboxes above a listbox, and use
them for the headers. Not as elegant, but it works!
 

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

Similar Threads


Top