HI Ashrak
Please wrap your Code in Code Tags. To do so go to Post #3, Edit Post, Highlight your Code, Click the # symbol, Click Save Changes.
Try this (not tested)
Option Explicit
Sub test()
Dim LR As Long
With ActiveSheet
LR = .Cells.Find("*", .Cells(Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
.Range("A1:B" & LR).Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(2), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
.Outline.ShowLevels RowLevels:=2
.Outline.ShowLevels RowLevels:=2
End With
End Sub
Bookmarks