Propriedade TextColumn

Identifica a coluna em um ComboBox ou ListBox para armazenar na propriedade Text quando o usuário seleciona uma linha.

Sintaxe

objeto. TextColumn [= Variant ]

A sintaxe da propriedade TextColumn tem estas partes:

Sair Descrição
objeto Obrigatório. Um objeto válido.
Variantes Opcional. A coluna a ser exibida.

Configurações

Values for the TextColumn property range from -1 to the number of columns in the list. The TextColumn value for the first column is 1, the value of the second column is 2, and so on.

Setting TextColumn to 0 displays the ListIndex values. Setting TextColumn to -1 displays the first column that has a ColumnWidths value greater than 0.

Comentários

Em uma caixa de combinação, o sistema exibe a coluna designada pela propriedade TextColumn na parte de caixa de texto do controle.

When the user selects a row from a ComboBox or ListBox, the column referenced by TextColumn is stored in the Text property.

For example, you could set up a multicolumn ListBox that contains the names of holidays in one column and dates for the holidays in a second column. To present the holiday names to users, specify the first column as the TextColumn. To store the dates of the holidays, specify the second column as the BoundColumn. Para ocultar as datas dos feriados, defina a propriedade ColumnWidths da segunda coluna como zero.

When the Text property of a ComboBox changes (such as when a user types an entry into the control), the new text is compared to the column of data specified by TextColumn.

Confira também

Suporte e comentários

Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.