I used a very simplistic data layout to develop this and after running the code below the data look like
I can't show the bars to the left to expand/collapse the subtotals but is this what your looking for? hers the code to achieve it if that's what you want. It assume the text are in column A
Dim LastRow As Long
Dim MyRange As Range
LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For x = LastRow To 2 Step -1
If Right(Cells(x, 1), 5) = "Total" And Cells(x, 1) <> "Grand Total" Then
Rows(x + 1).EntireRow.Insert
If this post answers your question, please mark it as the Answer.
If this response answers your question then please mark as answer.
1 person found this reply helpful
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.