万物皆对象,Excel也不例外。平时对Excel的各种操作,其实都是针对某个对象的操作。
那么,Excel中到底有多少个对象呢?很多,多的没有人愿意去统计。
退一步而言,有多少个常用对象呢?如下所示。
Object Type |
Description |
Application |
The current Excel Application. |
Columns |
The Columns object is a collection of all the Columns of a Worksheet. |
Range |
The Range object represents any number of contiguous cells on a Worksheet. This can be just one cell or it can be all the cells on the Worksheet. A range consisting of just one cell can be returned from a Worksheet, using the Cells property (i.e. Worksheet.Cells(1,1)). |
Rows |
The Rows object is a collection of all the Rows of a Worksheet. |
Sheets |
The Sheets object is a collection of all the Sheets in a Workbook. These Sheets can be Worksheets or Charts. |
Workbook |
A Workbook object can be accessed from the Workbooks Collection by using a Workbook index number or a Workbook name (e.g. Workbooks(1) or Workbooks("Book1")). You can also use 'ActiveWorkbook' to access the current active Workbook. |
Workbooks |
The Workbooks object is a collection of all of the open Excel Workbooks in the current Excel Application. |
Worksheet |
A Worksheet object can be accessed from the Sheets or the Worksheets object by using a Sheet or Worksheet index number or a Sheet or Worksheet name (e.g. Sheets(1), Worksheets(1), Sheets("Sheet1") or Worksheets("Wksheet1")). You can also use 'ActiveSheet' to access the current active Sheet. |
Worksheets |
The WorkSheets object is a collection of all the WorkSheets in a Workbook (i.e. all the Sheets, except the Charts). An individual Worksheet can be extracted from the Worksheets object by using an individual Worksheet index number or name (i.e. Worksheets(1) or Worksheets("Wksheet1")). |