Skip to content

Latest commit

 

History

History
60 lines (35 loc) · 1.54 KB

Excel.ControlFormat.List.md

File metadata and controls

60 lines (35 loc) · 1.54 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ControlFormat.List method (Excel)
vbaxl10.chm630080
vbaxl10.chm630080
Excel.ControlFormat.List
8ec9abd2-d5cf-8179-96e9-a8b583bb8bcc
04/23/2019
medium

ControlFormat.List method (Excel)

Returns or sets the text entries in the specified list box or combo box, as an array of strings, or returns or sets a single text entry. An error occurs if there are no entries in the list.

Syntax

expression.List (Index)

expression A variable that represents a ControlFormat object.

Parameters

Name Required/Optional Data type Description
Index Optional Variant The index number of a single text entry to be set or returned. If this argument is omitted, the entire list is returned or set as an array of strings.

Return value

Variant

Remarks

Setting this property clears any range specified by the ListFillRange property.

Example

This example sets the entries in a list box on worksheet one. If Shapes(2) doesn't represent a list box, this example fails.

Worksheets(1).Shapes(2).ControlFormat.List = _ 
 Array("cogs", "widgets", "sprockets", "gizmos")

This example sets entry four in a list box on worksheet one. If Shapes(2) doesn't represent a list box, this example fails.

Worksheets(1).Shapes(2).ControlFormat.List(4) = "gadgets"

[!includeSupport and feedback]