ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Totals across increasing number of worksheets (https://www.excelbanter.com/excel-programming/381175-totals-across-increasing-number-worksheets.html)

dd

Totals across increasing number of worksheets
 
Is there a way to sum the range, or array, C14:T22 over an increasing number
of worksheets, displaying the value in the same cell of worksheet "Totals"?

Regards
Dylan Dawson



Mike Fogleman

Totals across increasing number of worksheets
 
Sub Ttl()
Dim SumOne As Double, SumAll As Double
Dim i As Integer
Dim ws As Worksheet
Dim rng As Range

For i = 2 To Worksheets.Count
Set rng = Worksheets(i).Range("C14:T22")
SumOne = Application.Sum(rng)
SumAll = SumAll + SumOne
Next
Worksheets("Totals").Range("A1") = SumAll
End Sub

Mike F
"dd" <dd.dd wrote in message
...
Is there a way to sum the range, or array, C14:T22 over an increasing
number
of worksheets, displaying the value in the same cell of worksheet
"Totals"?

Regards
Dylan Dawson






All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com