_Chart.ListBoxes(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns or sets the text entries in the specified list box or a 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.
public object ListBoxes (object Index);
Public Function ListBoxes (Optional Index As Object) As Object
Parameters
- Index
- Object
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.
Returns
Variant
Examples
This example sets the entries in a list box on worksheet one. If Shapes(2) doesn’t represent a list box, this example fails.
<span class="label">Worksheets(1).Shapes(2).ControlFormat.</span>
<i>List</i>
<span class="label">= _ Array("cogs", "widgets", "sprockets", "gizmos")</span>
This example sets entry four in a list box on worksheet one. If Shapes(2) doesn’t represent a list box, this example fails.
<span class="label">Worksheets(1).Shapes(2).ControlFormat.</span>
<i>List</i>
<span class="label">(4) = "gadgets"</span>
This example sets the entries in a list box on worksheet one. If Shapes(2) doesn’t represent a list box, this example fails.
<span class="label">Worksheets(1).Shapes(2).ControlFormat.</span>
<i>List</i>
<span class="label">= _ Array("cogs", "widgets", "sprockets", "gizmos")</span>
This example sets entry four in a list box on worksheet one. If Shapes(2) doesn’t represent a list box, this example fails.
<span class="label">Worksheets(1).Shapes(2).ControlFormat.</span>
<i>List</i>
<span class="label">(4) = "gadgets"</span>
This example sets the entries in a list box on worksheet one. If Shapes(2) doesn’t represent a list box, this example fails.
<span class="label">Worksheets(1).Shapes(2).ControlFormat.</span>
<i>List</i>
<span class="label">= _ Array("cogs", "widgets", "sprockets", "gizmos")</span>
This example sets entry four in a list box on worksheet one. If Shapes(2) doesn’t represent a list box, this example fails.
<span class="label">Worksheets(1).Shapes(2).ControlFormat.</span>
<i>List</i>
<span class="label">(4) = "gadgets"</span>
Remarks
Setting this property clears any range specified by the ListFillRange property.
Applies to
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기