Solution I gathered form this forum and other forums
Code:
Sub sumx()
Dim LastRow As Long
LastRow = Range("P65536").End(xlUp).Row + 1
ActiveCell.Select
Selection.Formula = "=SUM(P" & LastRow + 1 & ":" & Format(ActiveCell.Row - 1, "P#") & ")"
End Sub
[SOLVED]