i have excel sheet with 5 columns. i used following code for sorting. it works fine
lrow As Long
lrow = Application.WorksheetFunction.CountA(Sheet2.Range("A:A"))
Sheet2.Range("A3:E" & lrow).Sort key1:=Range("E3:E" & lrow), order1:=xlAscending, Header:=xlNo ' sno column
my data look like this...
Refer to the image.
In the Mode column, there are seven 1's. I would like insert a row after the last one and calculate the total (arrow mark in the image).

Range.SubTotalmethod.