My total speasheet has 10 columns, the below code only calculates 1 (Surgical Dentures) column where would i add the the calculations for lets say, main surgery, clinical surgery, orthopedic surgert etc
<code>
Sub addtotals()
Dim i&, ts$, yr$
ts = "TOTAL"
yr = "2013"
On Error GoTo err1
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
Worksheets(ts).Range("I3:I8,O3:O8").ClearContents
'add upp the numbers to the TOTAL sheet -- in this example I only put the "Surgical Dentures" totals in.
For i = 1 To Worksheets.Count
If Left(Worksheets(i).Name, Len(yr)) <> yr Then GoTo nxi
Worksheets(ts).Range("I4").Value = Worksheets(ts).Range("I4").Value + Worksheets(i).Range("F101").Value
nxi:
Next i
</code>
Bookmarks