Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.2 KB

Excel.Range.ListHeaderRows.md

File metadata and controls

51 lines (33 loc) · 1.2 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Range.ListHeaderRows property (Excel)
vbaxl10.chm144154
vbaxl10.chm144154
Excel.Range.ListHeaderRows
d71a9b28-cd5d-677c-9ce1-f8de2b350e5f
05/11/2019
medium

Range.ListHeaderRows property (Excel)

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

Syntax

expression.ListHeaderRows

expression A variable that represents a Range object.

Remarks

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

Example

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

[!includeSupport and feedback]