Hi kortni
Here's the code to do what you require with VBA
Public Sub ProcessData_Subtotal()
Dim Lastrow As Long
Dim i As Long
Dim rUsed As Range
Application.ScreenUpdating = False
With ActiveSheet
Lastrow = .Cells(.Rows.Count, "D").End(xlUp).Row
For i = Lastrow - 1 To 2 Step -1
If Cells(i, "D").Value2 <> Cells(i + 1, "D").Value2 Then
.Rows(i + 1).Insert
End If
Next i
Set rUsed = .UsedRange
Application.DisplayAlerts = False
rUsed.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(15, 16, 17 _
), Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Application.DisplayAlerts = True
End With
Application.ScreenUpdating = True
End Sub
I should point out, you will need to change this line of code to reflect your worksheet structure
rUsed.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(15, 16, 17 _
), Replace:=True, PageBreaks:=False, SummaryBelowData:=True
John
Bookmarks