Collapse the table of content
Expand the table of content
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Range.ListHeaderRows Property (Excel)

Returns the number of header rows for the specified range. Read-only Long.

expression .ListHeaderRows

expression A variable that represents a Range object.

Before you use this property, use the CurrentRegion property to find the boundaries of the range.

This example sets the rTbl variable to the range represented by the current region for the active cell, not including any header rows.

Set rTbl = ActiveCell.CurrentRegion 
' remove the headers from the range 
iHdrRows = rTbl.ListHeaderRows 
If iHdrRows > 0 Then 
 ' resize the range minus n rows 
 Set rTbl = rTbl.Resize(rTbl.Rows.Count - iHdrRows) 
 ' and then move the resized range down to 
 ' get to the first non-header row 
 Set rTbl = rTbl.Offset(iHdrRows) 
End If
© 2015 Microsoft