Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: TextColumn Property Displays Only the First Column


View products that this article applies to.

Symptoms

When you set the TextColumn property for a ComboBox or ListBox control on a UserForm in a Microsoft Visual Basic for Applications macro, Microsoft Excel may display the first column in the range of data instead of the column that you specify.

↑ Back to the top


Workaround

To work around this problem, set the ColumnWidths property to 0 (zero) so that the column you want to display is the first column in the range of data that has a column width greater than 0. For example, if you want to display the second column in the list but return a value from the first column of the list, use the properties that are listed in the following table.

   Property        Value
   ---------------------
   BoundColumn         1
   ColumnCount         2
   ColumnsWidths       0
   TextColumn          2
				

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

The TextColumn property identifies the column in a ComboBox or ListBox that is displayed. Values for the TextColumn property range from -1 to the number of columns in the list. For example, the first column is 1, the second column is 2, and so on. Setting the TextColumn property to 0 displays the Listindex values. Setting the TextColumn property to -1 displays the first column that has a ColumnWidth greater than 0.

For additional information about the TextColumn property, please see the following article in the Microsoft Knowledge Base:
213722 XL2000: How to Use the TextColumn Property

↑ Back to the top


References

For more information about the TextColumn property, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type TextColumn Property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB211446, kbpending, kbbug

↑ Back to the top

Article Info
Article ID : 211446
Revision : 5
Created on : 10/10/2006
Published on : 10/10/2006
Exists online : False
Views : 311