Welcome to the Microsoft Office Excel 2007 Developer Reference
This reference contains conceptual overviews, programming tasks, samples, and references to guide you in developingsolutions based on Excel.
Press <Alt > < F11 > to view Visual Basic WindowOR Right Click on Sheet tab and click “View Code” Returning an Object from a Collection
property returns a single object from a collection. The following example sets the
variable to a
object that represents workbook one.
Set FirstBook = Workbooks.Item(1)
property is thedefault property(default property: A property that you can set for a control so that each time anew control of that type is created, this property will have the same value.)for most collections, so you can write the samestatement more concisely by omitting the
Set FirstBook = Workbooks(1)
For more information about a specific collection, see the Help topic for that collection or the
property for thecollection.