Class ListColumn (Excel VBA)

The class ListColumn represents a column in a table.

Member in collection

Item

To use a ListColumn class variable it first needs to be instantiated, for example

Dim lstcol as ListColumn
Set lstcol = ActiveCell.ListObject.ListColumns(Index:=1)

The following procedures can be used to set variables of type ListColumn: ListColumns.Add and ListColumns.Item.

For Each

Here is an example of processing the ListColumn items in a collection.

Dim lstcol As ListColumn
For Each lstcol In ActiveCell.ListObject.ListColumns
	
Next lstcol

Delete - Deletes the column of data in the list.

ListColumns.Add - Adds a new column to the list object.

Properties

Name (Default member) - Returns or sets a String value that represents the name of the list column. ListColumns.Item (Default member) - Returns a single object from a collection.

DataBodyRange returns a Range object that is the size of the data portion of a column.

Index returns a Long value that represents the index number of the ListColumn object within the ListColumns collection.

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

Total returns the Total row for a ListColumn object.

TotalsCalculation determines the type of calculation in the Totals row of the list column based on the value of the XlTotalsCalculation enumeration.

XPath returns an XPath object that represents the XPath of the element mapped to the specified Range object. The context of the range determines whether the action succeeds or returns an empty object.

ListColumns.Count returns an Integer value that represents the number of objects in the collection.

Range - Represents a cell, a row, a column, a selection of cells containing one or more contiguous blocks of cells, or a 3D range.

XPath - Represents an XPath that has been mapped to a Range or ListColumn object.