Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

column headers for Multicolumn list boxes - Excel VBA 1

Status
Not open for further replies.

JTBorton

Technical User
Jun 9, 2008
345
DE
Question 1)
I'm trying to create a multicolumn list box. The source will not be from the excel sheet, but from a variable array. I figured out how to add items to each column, but I cant figure out how to name the column headers what I want. Any suggestions?

Question 2)
If the source of the multicolumn list box is from the excel sheet, the column headings will be the cells directly above each column in the sheet. Can I choose the heading from other cells, as in ones that are not directly above the range I chose?

Question 3)
Can anyone give me a working example of how to use the .additem for a multicolumn list box? I populated my list using the following meathod:
With lstBox1
.ColumnCount = 3
.ColumnHeads = True

.AddItem [variable array reference]
.List(0, 1) = [variable array reference]
.List(0, 2) = [variable array reference]
End With

the .additem uses the following format that I do not understand .additem([pargitem], [pargindex]) and then it wants it to equal something. Any clue?

Thanks, Joshua
 
No F1 key on your keyboard ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Oh right, sorry about the multiple questions. First time user. I looked through the Microsft VB help and it only gave me very broad and general answers. Kind of the "the wind blows because it's windy" type answers. Not really that helpful. And no, pressing F1 doesn't help either.
 
Q1, Q2: column headers are activated only when excel range is used as the list source (RowSource). They are taken from the row directly above this range or default column names if the list starts in first row. You can use label above the list to imitate the header in other cases.

combo
 
Ok thanks. Ill see what I can work around with that in mind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top