HeaderRowRange Property

Microsoft Excel Visual Basic

Show All Show All

HeaderRowRange Property

Returns a Range object that represents the range of the header row for a list. Read-only Range.

expression.HeaderRowRange

expression    Required. An expression that returns a Range object.

Example

The following example activates the range specified by the HeaderRowRange property of the default ListObject object in the first worksheet of the active workbook.

    Sub ActivateHeaderRow()
    Dim wrksht As Worksheet
    Dim objList As ListObject
    Dim objListRng As Range
   
    Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
    Set objList = wrksht.ListObjects(1)
    Set objListRng = objList.HeaderRowRange
   
    objListRng.Activate
End Sub