HasTable Property

       

Returns msoTrue if the shape represents a TableFrame object or msoFalse if the shape represents any other object type. Read-only MsoTriState.

MsoTriState can be one of these MsoTriState constants.
msoCTrue  Not used with this property.
msoFalse  The shapes in the range do not represent a TableFrame object.
msoTriStateMixed  Indicates a combination of msoTrue and msoFalse for the specified shape range.
msoTriStateToggle  Not used with this property.
msoTrue  The shapes in the range represent a TableFrame object.

expression.HasTable

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example checks the currently selected shape to see if it is a table. If it is, the code sets the width of column one to one inch (72 points).

 Sub IsTable()

    With Application.Selection.ShapeRange
        If .HasTable = msoTrue Then
            .Table.Columns(1).Width = 72
        End If
    End With

End Sub