Shazam
08-31-2006, 01:42 PM
I have a code that acts like a subtotal. But I would like it to be modified. Please look at the small example attachment. It will give you a better visual sense.
Sub Subtotal()
For Each NumRange In Columns("A").SpecialCells(xlCellTypeConstants, 23).Areas
SumAddr = NumRange.Address(False, False)
NumRange.Offset(NumRange.Count, 0).Resize(1, 2).Formula = "=SUM(" & SumAddr & ")"
c = NumRange.Count
Next NumRange
NoData:
End Sub
Sub Subtotal()
For Each NumRange In Columns("A").SpecialCells(xlCellTypeConstants, 23).Areas
SumAddr = NumRange.Address(False, False)
NumRange.Offset(NumRange.Count, 0).Resize(1, 2).Formula = "=SUM(" & SumAddr & ")"
c = NumRange.Count
Next NumRange
NoData:
End Sub