Cells Collection Object
Word Developer Reference |
A collection of Cell objects in a table column, table row, selection, or range.
Remarks
Use the Cells property to return the Cells collection. The following example formats the cells in the first row in table one in the active document to be 30 points wide.
Visual Basic for Applications |
---|
|
The following example returns the number of cells in the current row.
Visual Basic for Applications |
---|
|
Use the Add method to add a Cell object to the Cells collection. You can also use the InsertCells method of the Selection object to insert new cells. The following example adds a cell before the first cell in myTable.
Visual Basic for Applications |
---|
|
Use Cell(row, column), where row is the row number and column is the column number, or Cells(index), where index is the index number, to return a Cell object. The following example applies shading to the second cell in the first row in table one.
Visual Basic for Applications |
---|
|
The following example applies shading to the first cell in the first row.
Visual Basic for Applications |
---|
|
Remarks
Use the Add method with the Rows or Columns collection to add a row or column of cells. The following example adds a column to the first table in the active document and then inserts numbers into the first column.
Visual Basic for Applications |
---|
|
See Also