共用方式為


ControlFormat.ListFillRange Property (Excel)

Returns or sets the worksheet range used to fill the specified list box. Setting this property destroys any existing list in the list box. Read/write String.

Syntax

expression .ListFillRange

expression A variable that represents a ControlFormat object.

Remarks

Microsoft Excel reads the contents of every cell in the range and inserts the cell values into the list box. The list tracks changes in the range’s cells.

If the list in the list box was created with the AddItem method, this property returns an empty string ("").

Example

This example adds a list box to worksheet one and sets the fill range for the list box.

With Worksheets(1) 
 Set lb = .Shapes.AddFormControl(xlListBox, 100, 10, 100, 100) 
 lb.ControlFormat.ListFillRange = "A1:A10" 
End With

請參閱

概念

ControlFormat Object

ControlFormat Object Members