View Single Post
  #2   Report Post  
Bruno Campanini
 
Posts: n/a
Default

"malik641" wrote in
message ...

I have a defined name that holds the names of each relevant worksheet I
want to calculate.


Do you mean a Collection of worksheets you want to calculate?

-------------------------------------
Dim i, SumOfA1Cells as Currency
For Each i In NameOfSheets
SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
Next
-------------------------------------

Lets Say I want to sum every A1 in each worksheet in the defined name.
How would I go about doing that?


Or, for any worksheet in active workbook:
--------------------------------------------
Dim i, SumOfA1Cells As Currency
For Each i In ThisWorkbook.Worksheets
SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
Next
--------------------------------------------

Bruno