Quote Originally Posted by andy_sea
Please find below the code for subtotals:

Selection.Subtotal GroupBy:=1, Function:=xlCount, TotalList:=Array(1), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
End Sub


But I get the Microsoft message box after this step which is not getting recorded. It is waiting for me to click the "OK" button and then proceeds.

Thanks,
Andy
Does the macro you run include the setting of a Range or ActiveCell? - or did you set that before running the macro, and What is the error message?

---