Example

Worksheets(1).Copy After:=Worksheets(3)

OBJECT COLLECTIONS

The Excel Object Model allows for multiple objects of the same type, such as multiple open Worksheet objects in a workbook. To make these objects more accessible, Excel groups them together in an object collection. For example, each Workbook object contains a Worksheets collection. You access a collection similar to an array where an index value is used to reference the desired value in the collection. The following code accesses the second worksheet in the Worksheets collection:

0 0

Post a comment