Below is My COde
But I am getting =SUBTOTAL(9,'B2':'B16') in the result cell
Sub Subtotal()
'
' Macro1 Macro
'
Dim rwMax As Integer
Dim MYRANGE As Range
rwMax = Cells(Rows.Count, 1).End(xlUp).Row
Range("B" & rwMax + 1).Select
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,B2:B" & rwMax & ")"
End Sub
But I am getting =SUBTOTAL(9,'B2':'B16') in the result cell