Hello, how would I go about to modifying this code so that it will calculate the total of all the account totals? The code below is below is supposed to look for account totals in each department in each sheet and if that department has more than 1 account total the macro will give it a "grand total" at the end of that department but the grand total doesn't have numbers in it. So how can I gather the number from the account total and sum it into grand total.
Code:
Sub AddGT()
Dim ab As Range
Dim i As Long, lRow As Long, j As Long
Dim Streak As Integer
Dim sht As Worksheet
Dim wsn
Dim nam As String
Application.ScreenUpdating = False
wsn = Array("Francisca", "Lucria", "Alberto", "Amanda", "Early Child", "Melanie", _
"Natasha&Tom", "Maria", "Jess", "Grosv KDGN", "Tashana", "Space Rental")
For j = LBound(wsn) To UBound(wsn)
nam = wsn(j)
Worksheets(nam).Activate
MsgBox ActiveSheet.Name
lRow = Cells(Rows.Count, 2).End(xlUp).Row
Set ab = Range("B1:B" & lRow)
For i = 1 To ab.Rows.Count
If ab.Rows.Count = 1 Then Streak = 0
If ab(i).Offset(0, -1) Like "Department*" Then
If Streak >= 2 Then Cells(ab(i).Row - 1, 3).Value = "GRAND TOTAL"
Streak = 0
End If
If ab(i) = "ACCOUNT TOTAL" Then Streak = Streak + 1
Next
If Streak >= 2 Then
Streak = 0
Cells(ab(i).Row + 1, 3).Value = "GRAND TOTAL"
End If
Next j
Application.ScreenUpdating = True
End Sub