I have a table that will of course grow as it is added to. I need a button that will sum column G whether it has 10 rows or 1000. The table itself will be added to multiple times a day for a couple of years. It has headers.
-Thanks!
I have a table that will of course grow as it is added to. I need a button that will sum column G whether it has 10 rows or 1000. The table itself will be added to multiple times a day for a couple of years. It has headers.
-Thanks!
Is this what your looking for?
Please Login or Register to view this content.
Or if it's a table, maybe
Please Login or Register to view this content.
Im having a tad of trouble with pointing to that column. Im getting subscript out of range. Please note the button will be on a different page from the table.
Sub GetTotal()
With Sheet11.ListObjects("Table1")
.ShowTotals = True
.ListColumns("Calculated Rig Charge Difference (lbs)").TotalsCalculation = xlTotalsCalculationSum
v = .TotalsRowRange(.ListColumns("Calculated Rig Charge Difference (lbs)").Index).Value
.ShowTotals = False
MsgBox v
End With
End Sub
Things to note:
The table is Table1
I have the code in Sheet11 in vba
the button is on sheet 1
the table is on sheet 11 in column 'I' with a header
I did assign the macro to the button
hi,
you best option is to lower your table and then set a formula above the table in the G column
Formula:Please Login or Register to view this content.
that will always sum all the values whatever amount of rows there are.
Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
If you have been helped, maybe you could click the *
I'm only getting that if there's a typo in the Sheet name, header or table name.Im getting subscript out of range
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks