Adding Headers to a listbox

M

Mike Milligan

I have a multicolumn listbox that I've been using for sometime. I've
recently decided I want to add column headers to the listbox. I set
columnheads to true, but have not found a way to programmatically add the
header names. How do I do this?

Thanks in advance for reply,
Mike
 
R

robotman

I believe you just set the header cell values to what you want them to
be. No special property assignments are necessary for the cell.

So if your headers are in A1, B1, C1

Range("A1") = "myheader1"
Range("B1") = "myheader2"
Range("C1") = "myheader3'
 
J

Jim Rech

You have to set RowSource to a spreadsheet range that is just below the
column headers you want, but does not include them.

For example, if your headers are in A1:C1 and the data is in A2:C10, you set
RowSource to A2:C10.

http://support.microsoft.com/kb/211899

--
Jim
|I have a multicolumn listbox that I've been using for sometime. I've
| recently decided I want to add column headers to the listbox. I set
| columnheads to true, but have not found a way to programmatically add the
| header names. How do I do this?
|
| Thanks in advance for reply,
| Mike
|
|
 
M

Mike Milligan

That works great if I'm using Rowsource. How do I get headers when I am
populating the listbox via VBA (ie. the data isn't in a spreadsheet)?
 

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