Class Cells (Word VBA)

A collection of Cell objects in a table column, table row, selection, or range.

The classes Column, Range, Revision, Row and Selection. give access to class Cells


Dim clls as Cells
Set clls = Selection.Cells

For Each

Here is an example of processing the Cells items in a collection.


Dim cll As Cell
For Each cll In Selection.Cells
	
Next cll

Methods

Add - Returns a Cell object that represents a cell added to a table.

AutoFit - Changes the width of a table column to accommodate the width of the text without changing the way text wraps in the cells.

Delete - Deletes a table cell or cells and optionally controls how the remaining cells are shifted.

DistributeHeight - Adjusts the height of the specified cells so that they are equal.

DistributeWidth - Adjusts the width of the specified cells so that they are equal.

Item - Returns an individual Cell object in a collection.

Merge - Merges the specified table cells with one another. The result is a single table cell.

SetHeight - Sets the height of table cells.

SetWidth - Sets the width of columns or cells in a table.

Split - Splits a range of table cells.

Properties

Borders returns a Borders collection that represents all the borders for the specified object.

Count returns the number of items in the Cells collection.

Height returns or sets the height of the specified table cells.

HeightRule returns or sets a WdRowHeightRule constant that represents the rule for determining the height of the specified cells.

NestingLevel returns the nesting level of the specified cells.

PreferredWidth returns or sets the preferred width (in points or as a percentage of the window width) for the specified cells.

PreferredWidthType returns or sets the preferred unit of measurement to use for the width of the specified cells.

Shading returns a Shading object that refers to the shading formatting for the specified object.

VerticalAlignment returns or sets the vertical alignment of text in one or more cells of a table.

Width returns or sets the width of the table cells, in points.