ListBoxes Method

Applies To

Chart Object, DialogSheet Object, Worksheet Object.

Description

Accessor. Returns an object that represents a single list-box control (a ListBox object, Syntax 1) or a collection of list-box controls (a ListBoxes object, Syntax 2) on the sheet.

Syntax 1

object.ListBoxes(index)

Syntax 2

object.ListBoxes

object

Required. The Chart, DialogSheet, or Worksheet object.

index

Required for Syntax 1. Specifies the name or number of the list box (can be an array to specify more than one).

Example

This example fills list box one on Dialog1 with the letters A through Z.


For i = 65 To 90
    DialogSheets("Dialog1").ListBoxes(1).AddItem Text:=Chr(i)
Next i