VBA ListObject Object in Excel

VBA ListObject Object in Excel

VBA ListObject Object in Excel. The ListObjects collection contains listobject objet. It represents a object on worksheet and most powerful feature. This object contains different methods and properties. In the following tutorial you learn methods, properties of listobject object. And also learn syntax of it.

VBA ListObject Object Methods & Properties

We have different methods and properties for ListObject Object in Excel VBA.

The methods are Delete, ExportToVisio,Publish, Refresh, Resize, Unlink, and Unlist in Excel VBA.

VBA ListObject Object

The properties are Active, AlternativeText, Application, AutoFilter, Comment, Creator, DataBodyRange, DisplayName, DisplayRightToLeft, HeaderRowRange, InsertRowRange, ListColumns, ListRows, Name, Parent, QueryTable, Range, SharePointURL, ShowAutoFilter, ShowAutoFilterDropDown, ShowHeaders, ShowTableStyleColumnStripes, ShowTableStyleFirstColumn, ShowTableStyleLastColumn, ShowTableStyleRowStripes, ShowTotals, Slicers, Sort, SourceType, Summary, TableObject, TableStyle, TotalsRowRange, and XmlMap.

Let us see complete details about methods & properties and.

VBA ListObject Object Methods in VBA

Here are the listobject object methods in VBA. Let us see syntax each method.

Delete

Deletes the ListObject object and clears data on the Worksheet cells.

ListObject.Delete

ExportToVisio

Exports a ListObject object to Visio.

ListObject.ExportToVisio

Publish

Publishes the ListObject object to a server that is running Microsoft SharePoint Foundation.

ListObject.Publish (Target, LinkSource)

Where
Target is a required parameter. It contains array of strings variant type data.
LinkSource is a required parameter. It contains Boolean type data depending on the target.

Refresh

Retrieves the current data and schema for the list from the server that is running Microsoft SharePoint Foundation.

ListObject.Refresh

Resize

The Resize method allows a ListObject object to be resized over a new range. No cells are inserted or moved.

ListObject.Resize (Range)

Unlink

Removes the link to a Microsoft SharePoint Foundation site from a list and returns Nothing.

ListObject.Unlink

Unlist

Removes the list functionality from a ListObject object. After use, the range of cells that made up the the list will be a regular range of data.

ListObject.Unlist

VBA ListObject object Properties in VBA

Let us see the the listobject object properties in VBA. Let us see syntax of each property.

Active

Checks the active cell is inside the range of the ListObject object. It returns a Boolean value indicating whether a ListObject object on a worksheet is active or not. It allows to read only.

ListObject.Active

AlternativeText

This property returns or sets the descriptive text string for the specified table. It allows to read or write.

ListObject.AlternativeText

Application

It is a property and returns an Application object that represents the Microsoft Excel application.

ListObject.Application

AutoFilter

It filters a table using the AutoFilter feature. It allows to read only.

ListObject.AutoFilter

Comment

This property returns or sets the comment associated with the list object. It is to read or write and string type data.

ListObject.Comment

Creator

It returns a 32-bit integer. It represents the application in which this object was created. It allows to read only and Long type data.

ListObject.Creator

DataBodyRange

It returns a Range object that represents the range of values, excluding the header row, in a table. It allows to read only.

ListObject.DataBodyRange

DisplayName

This property returns or sets the display name for the specified ListObject object. It allows to read or write and string type data.

ListObject.DisplayName

DisplayRightToLeft

True if the specified ListObject is displayed from right to left instead of from left to right. False if the object is displayed from left to right. It allows to read only and Boolean type data.

ListObject.DisplayRightToLeft

HeaderRowRange

It returns a Range object that represents the range of the header row for a list. It allows to read only and contains range object.

ListObject.HeaderRowRange

InsertRowRange

This property returns a Range object representing the Insert row for the specified ListObject object. It allows to read only and contains range object.

ListObject.InsertRowRange

ListColumns

It returns a ListColumns collection that represents all the columns in a ListObject object. It allows to read only.

ListObject.ListColumns

ListRows

It returns a ListRows collection that represents all the columns in a ListObject object. It allows to read only.

ListObject.ListRows

Name

This property returns or sets a String value that represents the name of the ListObject object.

ListObject.Name

Parent

It returns the parent object for the specified object. It allows to read only.

ListObject.Parent

QueryTable

This property returns the QueryTable object that provides a link for the ListObject object to the list server. It allows to read only.

ListObject.QueryTable

Range

It returns a Range object that represents the range to which the specified list object in the list applies.

ListObject.Range

SharePointURL

Returns a String representing the URL of the SharePoint list for a given ListObject object. It allows to read only and string type data.

ListObject.SharePointURL

ShowAutoFilter

This property returns Boolean to indicate whether the AutoFilter will be displayed. It allows to read or write and conatins Boolean type data.

ListObject.ShowAutoFilter

ShowAutoFilterDropDown

It returns True when the AutoFilter drop-down for the ListObject object is displayed. It allows to read or write and conatins Boolean type data.

ListObject.ShowAutoFilterDropDown

ShowHeaders

It returns or sets if the header information should be displayed for the specified ListObject object. It allows to read or write and conatins Boolean type data.

ListObject.ShowHeaders

ShowTableStyleColumnStripes

This property returns or sets if the Column Stripes table style is used for the specified ListObject object. It allows to read or write and conatins Boolean type data.

ListObject.ShowTableStyleColumnStripes

ShowTableStyleFirstColumn

It returns or sets if the first column is formatted for the specified ListObject object. It allows to read or write and conatins Boolean type data.

ListObject.ShowTableStyleFirstColumn

ShowTableStyleLastColumn

It returns or sets if the last column is displayed for the specified ListObject object. It allows to read or write and conatins Boolean type data.

ListObject.ShowTableStyleLastColumn

ShowTableStyleRowStripes

This property returns or sets if the Row Stripes table style is used for the specified ListObject object. It allows to read or write and conatins Boolean type data.

ListObject.ShowTableStyleRowStripes

ShowTotals

It gets or sets a Boolean to indicate whether the Total row is visible.It allows to read or write and conatins Boolean type data.

ListObject.ShowTotals

Slicers

It returns a list of the table slicers associated with a ListObject. It allows to read.

ListObject.Slicers

Sort

It gets or sets the sort column or columns and sort order for the ListObject collection.

ListObject.Sort

SourceType

This property returns an XlListObjectSourceType value that represents the current source of the list.

ListObject.SourceType

Summary

It returns or sets the description associated with the alternative text string for the specified table. It allows to read or write.

ListObject.Summary

TableObject

This property returns a TableObject object. It allows to read only.

ListObject.TableObject

TableStyle

It gets or sets the table style for the specified ListObject object. It allows to read or write and contains variant type data.

ListObject.TableStyle

TotalsRowRange

This property returns a Range object representing the Total row, if any, from a specified ListObject object. It allows to read only.

ListObject.TotalsRowRange

XmlMap

It returns an XmlMap object that represents the schema map used for the specified table. It allows to read only.

ListObject.XmlMap

Instructions to Run VBA Macro Code or Procedure:

You can refer the following link for the step by step instructions.

Instructions to run VBA Macro Code

Other Useful Resources:

Click on the following links of the useful resources. These helps to learn and gain more knowledge.

VBA Tutorial VBA Functions List VBA Arrays in Excel VBA Tables and ListObjects

VBA Editor Keyboard Shortcut Keys List VBA Interview Questions & Answers Blog

Leave a Comment