• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Listobject total problem

horvathg

New Member
Normally when you add a total row to a listobject manually, they will accept the filter on the table.
When I add a total row by VBA:
Code:
With ActiveSheet.ListObjects("Table1")
        .ShowTotals = True
        .ListColumns("Qty").TotalsCalculation = xlTotalsCalculationSum
        .ListColumns("Amount").TotalsCalculation  = xlTotalsCalculationSum
End With

The totals allways show grandtotal, not accepting the filter.
The formula generated by code above in the total row is like this:

=SUBTOTAL(109;[Qty])

Any advise ?
 
I found the solution. After setting the total calculation, just turn on, turn off and turn on again the total row. :(
Using Excel 2010

Code:
.ShowTotals = True
.ShowTotals = False
.ShowTotals = True
 
Hi, horvathg!
Glad you could solved it by yourself. Thanks for your feedback and for sharing your solution with the community. And welcome back whenever needed or wanted.
Regards!
 
Back
Top