Share via


CustomProperties.Item Property

Excel Developer Reference

Returns a single object from a collection.

Syntax

expression.Item(Index)

expression   A variable that represents a CustomProperties object.

Parameters

Name Required/Optional Data Type Description
Index Required Variant The name or index number of the object.

Example

The following example demonstrates this feature. In this example, Microsoft Excel adds identifier information to the active worksheet and returns the name and value to the user.

Visual Basic for Applications
  Sub CheckCustomProperties()
Dim wksSheet1 As Worksheet

Set wksSheet1 = Application.ActiveSheet

' Add metadata to worksheet.
wksSheet1.CustomProperties.Add _
    Name:="Market", Value:="Nasdaq"

' Display metadata.
With wksSheet1.CustomProperties.<strong>Item</strong>(1)
    MsgBox .Name &amp; vbTab &amp; .Value
End With

End Sub

See Also