An object is a special type of variable that contains both data and code and that represents a specific element in Microsoft Excel. Objects exist only in the memory of the computer; they don't appear in the code you write.
Objects have types, just as other kinds of variables have data types. Object types are called classes; Workbook, Worksheet, and Range are a few of the Microsoft Excel object classes. When you know an object's class, you can use Help to find the object's properties and methods.
Visual Basic supports a set of objects that correspond directly to elements in Microsoft Excel, most of which you're familiar with from the user interface. For example, the Workbook object represents a workbook, the Worksheet object represents a worksheet, and the Range object represents a range of cells. To perform a task using Visual Basic, you return an object that represents the appropriate Microsoft Excel element and then manipulate it using that object's properties and methods. For example, the following illustration shows how Visual Basic sets the value of a cell, using the Value property of the Range object.
It's important to remember that the Worksheet and Range objects in this example never appear in the Visual Basic code — they exist only in the memory of the computer. However, the Worksheets method and the Range method, which return the objects, do appear in the code.