If I have a set of cells in a worksheet that I want to add up, I can use the formula:
=SUM(Sheet1!A1:A10)
To do this in a sub, I would use:
Sub SumWorksheets()
Dim ws As Worksheet
Dim v As Variant
For Each ws In ThisWorkbook.Worksheets
' If ws.Name <> ThisWorkbook.ActiveSheet.Name Then ' (Sum other sheets only)
If ws.Name <> "" Then
Application.DisplayAlerts = False
v = v + ws.Range("B2")
Application.DisplayAlerts = True
End If
Next ws
MsgBox v
End Sub