Style Object and the Styles Collection

The Styles collection holds the list of user-defined and built-in formatting styles, such as Currency and Normal, in a workbook or range. Each Style object represents formatting attributes associated with the parent object. There are some Excel built-in Style objects, such as Currency. Also, new styles can be created. Possible parents of the Styles collection are the Range and Workbook objects.

The Styles collection has two extra attributes besides the typical collection ones. The Add method uses the Name parameter to add a new style to the collection. The BasedOn parameter of the Add method can be used to specify a range that the new style will be based on. The Merge method merges the styles in the workbook specified by the Workbook parameter into the current parent workbook.

0 0

Post a comment