Microsoft Office Tutorials and References
In Depth Information
Explore the Excel Object Model
Chapter 11: Learning VBA Basics
You can use VBA to create new worksheets, copy, move, and delete worksheets, and more. You
can reference a specific worksheet either by using the ActiveSheet object, which represents the
worksheet that currently has the focus, or by using the Worksheets collection, which represents all
the worksheets currently open in Excel. Here are some examples:
Returns the name of the worksheet.
Returns or sets the standard row height.
Returns or sets the standard column width.
Hides or displays a worksheet.
Creates a new worksheet.
Copies a worksheet.
Moves a worksheet.
Deletes a worksheet.
You can use VBA to select a range, add data to a range, format a range, and more. You can
reference a specific cell by using the ActiveCell object, which represents the worksheet cell that
currently has the focus. You can also use the WorkSheet object’s Range method to specify a range
using a reference or a defined name. Here are some examples:
Returns the address of the range.
Returns the number of cells in the range.
Returns or sets the data or formula for the range.
Cuts a range to the Clipboard.
Copies a range to the Clipboard.
Clears all data and formatting from a range.