ListObject.Name Property (Excel)

Returns or sets a String value that represents the name of the ListObject object.

Syntax

expression .Name

expression An expression that returns a ListObject object.

Return Value

String

Remarks

This name is used solely as a unique identifier for the Item property of the **ListObjects**collection objects. This property can only be set through the object model.

By default, each ListObject object name begins with the word "List", followed by a number (no spaces). If an attempt is made to set the Name property to a name already used by another ListObject object, a run-time error is thrown.

Example

The following example displays the name of the default ListObject object in sheet1 of the active workbook.

Sub Test 
 Dim wrksht As Worksheet 
 Dim oListObj As ListObject 
 
 Set wrksht = ActiveWorkbook.Worksheets("Sheet1") 
 Set oListObj = wrksht.ListObjects(1) 
 
 MsgBox oListObj.Name 
End Sub

See Also

Concepts

ListObject Object Members

ListObject Object