Share via


TotalsRowRange Property [Excel 2003 VBA Language Reference]

Returns a Range representing the Total row, if any, from a specified ListObject object. Read-only.

expression.TotalsRowRange

expression Required. An expression that returns

Visit ListObject

object.

Example

The following sample code returns the address of the Total row in the default list in Sheet1 of the active workbook. The code displays the Total row if it is not displayed already.

Sub DisplayTotalsRowAddress()
    Dim wrksht As Worksheet
    Dim objListObj As ListObject
    
    Set wrksht = ActiveWorkbook.Worksheets("Sheet2")
    Set objListObj = wrksht.ListObjects(1)
    objListObj.ShowTotals = True
    MsgBox objListObj.TotalsRowRange.Address
End Sub

Applies to | ListObject Object