Excel) (Range.ListHeaderRows 屬性

會傳回指定範圍中標題列的列數。 唯讀的 Long

語法

運算式ListHeaderRows

expression 代表 Range 物件的變數。

註解

使用此屬性之前,請使用 CurrentRegion 屬性來尋找範圍的界限。

範例

本範例會將 變數設定 rTbl 為使用中儲存格的目前區域所代表的範圍,不包括任何標頭資料列。

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

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應