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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP! Setting a ListBox's column heading 1

Status
Not open for further replies.

b0nkers

Technical User
Dec 16, 2002
3
CA
I feel like I'm going crazy - this should be so simple, but I can't figure out how to do it!

I need to set the heading of a listbox in my code. I'm not populating the listbox from a range, I actually want to assign the value in my code.

So, it's a 4 column list box. Each column needs a heading.
I can switch headings on with ListBox.ColumnHeads ; I can set the number of columns with ListBox.ColumnCount but how on earth do I actually PUT something into the headers?

I've looked through previous posts, and this question has come up before, but there didn't seem to be an answer.

Can anyone help?

thanks in advance,
G
 
The answer is that you just can't do it - like you I once spent many hours trying to figure it out and eventually came across some article dispelling all beliefs I had that you could. Unfortunately I can't remember where I saw that to prove it to you, so you'll have to take my word on it. (I would be more than happy for someone to prove me wrong on this as I suspect I would use it all the time)

Hope this helps....

asjeff
 
OFF97: Cannot Implement ListBox, ComboBox Control ColumnHeads Property
ID: Q164343



--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft PowerPoint 97 For Windows
Microsoft Word 97 for Windows
Microsoft Outlook 97
Microsoft Outlook 98

--------------------------------------------------------------------------------


SYMPTOMS
When you set the ColumnHeads property for a ListBox control or a ComboBox control to True, column headings are displayed. However, there is no method for populating the column headings with values, for the products that are listed at the beginning of this article.



CAUSE
You must use the ColumnHeads property with the ListFillRange, Control Source, or Row Source properties to populate the headings. These properties are not available in the products that are listed at the beginning of this article.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.



MORE INFORMATION
The ColumnHeads property works with the ListFillRange property, which is available in Excel, or the Control Source and Row Source properties, which are available in Access. When you use the ListFillRange property in Excel, you can specify a range of values that automatically populate a ListBox or ComboBox control. When you set the value of the ColumnHeads properties to True, each column in the ListBox or ComboBox control contains a heading for the relative column in the range.

For example, in Excel, if the ListFillRange property value is A1:C4, the value of the ColumnCount property is 3, and the value of the ColumnHeads property is True, the column headings are the following:


Column A | Column B | Column C.



REFERENCES
For more information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:


ARTICLE-ID: Q163435
TITLE : VBA: Programming Resources for Visual Basic for Applications

Additional query words: wordcon word8 word97 ppt8 8.00 8.0 vb vbe vba ol97 ol98 OFF97


Keywords : kbprg kbdta kbdtacode OffVBA KbVBA
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug



Last Reviewed: May 25, 1999
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.
 
That's the one Justin - I knew I had seen it somewhere. Have a star - that article should clear any confusion up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top