Count (ColumnHeader, ListItem, CommandBar)

This property returns the number of items in a collection.

Syntax

object.Count

Parameters

object
Object expression that evaluates to a collection.

Remarks

You can use this property with a For...Next statement to carry out an operation on the forms or controls in a collection.

The following code example shows how to move all controls on a form 0.5 inches to the right (ScaleMode property setting is 1 or vbTwips).

For I = 0 To Form1.Controls.Count - 1
    Form1.Controls(I).Left = Form1.Controls(I).Left + 720
Next I