This documentation is archived and is not being maintained.

ListColumns Property [Excel 2003 VBA Language Reference]

Office 2003

Returns a

Visit

collection that represents all the columns in a

Visit

object. Read-only.

expression.ListColumns

expression Required. An expression that returns a

Visit

object.

Example

The following example displays the name of the second column in the ListColumns collection object as created by a call to the ListColumns property. For this code to run, the Sheet1 worksheet must contain a list.

Sub DisplayColumnName
    Dim wrksht As Worksheet
    Dim objListObj As ListObject
    Dim objListCols As ListColumns
   
    Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
    Set objListObj = wrksht.ListObjects(1)
    Set objListCols = oListObj.ListColumns
   
    Debug.Print objListCols(2).Name
End Sub


Applies to | ListObject Object


Show: