Selection.Cells Property (Word)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns a Cells collection that represents the table cells in a selection. Read-only.

expression .Cells

expression A variable that represents a Selection object.

For information about returning a single member of a collection, see Returning an Object from a Collection.

This example sets the current cell's background color to red.

If Selection.Information(wdWithInTable) = True Then 
 Selection.Cells(1).Shading.BackgroundPatternColorIndex = wdRed 
 MsgBox "The insertion point is not in a table." 
End If