TotalsRowRange Property

Microsoft Excel Visual Basic

TotalsRowRange Property

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

expression.TotalsRowRange

expression    Required. An expression that returns 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