so the column is:
1
1
1
2
2
2
I want it to do this:
1
1
1
autosum column C
2
2
2
I found a similar one but it does it for column E. I need it for column C and I need to add two rows after every value change.
Sub sbttls()
Dim aArea As Range, i As Integer
i = 0
For Each aArea In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants).Areas
i = i + 1
If i <> 1 Then
With Cells(aArea.Row + aArea.Rows.Count, 5)
.Value = WorksheetFunction.Sum(Range(Cells(aArea.Row, 5), Cells(aArea.Row + aArea.Rows.Count - 1, 5)))
With .Font
.ColorIndex = 5
.Bold = True
End With
End With
End If
Next aArea
End Sub
Bookmarks