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 on 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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.