Class CustomProperties (Excel VBA)

A collection of CustomProperty objects that represents additional information. The information can be used as metadata for XML. To use a CustomProperties class variable it first needs to be instantiated, for example


Dim cps as CustomProperties
Set cps = ActiveSheet.CustomProperties

For Each

Here is an example of processing the CustomProperties items in a collection.


Dim cprpCustomPropertie As CustomProperty
For Each cprpCustomPropertie In ActiveSheet.CustomProperties
	
Next cprpCustomPropertie

Add

Adds custom property information.

Add (Name, Value)


Dim strName As String: strName = 
Dim cprp As CustomProperty
Set cprp = ActiveSheet.CustomProperties.Add(Name:=strName, Value:=)

Arguments

The following arguments are required:

Name (String) - The name of the custom property.

Value (Variant) - The value of the custom property.

Count

Returns a Long value that represents the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveSheet.CustomProperties.Count

Item

Returns a single object from a collection.

Item (Index)

Index: The index number of the object.


Dim cprpItem As CustomProperty
Set cprpItem = ActiveSheet.CustomProperties(Index:=1)